![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is ResultSet Concurrency in JDBC?
The concurrency of the ResultSet object determines whether its contents can be updated or not.
The Connection interface provides 3 variants of the createStatement() method where one of the method's signature is as follows:
Statement createStatement(int resultSetType, int resultSetConcurrency)
This method accepts two integer type variables where one represents the type of the ResultSet and the other represents the Concurrency of the ResultSet.
The ResultSet interface provides two values to specify the concurrency of the ResultSet.
CONCUR_READ_ONLY: If you set this as a value of the concurrency while creating the ResultSet object you cannot update the contents of the ResultSet you can only read/retrieve them.
CONCUR_UPDATABLE: If you set this as a value of the concurrency while creating the ResultSet object you can update the contents of the ResultSet.
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); Or, Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet. ResultSet.CONCUR_UPDATABLE);