- Trending Categories
- Data Structure
- Operating System
- C Programming
- 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);
- What is Type_FORWARD_ONLY ResultSet in JDBC?
- What is TYPE_SCROLL_INSENSITIVE ResultSet in JDBC?
- What is TYPE_SCROLL_SENSITIVE ResultSet in JDBC?
- What is ResultSet holdability in JDBC?
- What is CONCUR_UPDATABLE ResultSet in JDBC? Explain?
- What is CONCUR_READ_ONLY ResultSet in JDBC? Explain?
- What is concurrency in Java?
- What is Result in JDBC? How to retrieve data from ResultSet object?
- What is concurrency control in DBMS?
- What is Concurrency Testing in Software Testing?
- What is an optimistic concurrency control in DBMS?
- What is JDBC?
- Explain the difference between RowSet and ResultSet in JDBC?
- How to insert rows into a ResultSet in JDBC?
- How do you check if a ResultSet is empty or not in JDBC?