JDBC 3.0 adds support for specifying result set (or cursor) holdability. Result set holdability is the ability to specify whether cursors (or a result set as java.sql.ResultSet objects) should be held open or closed at the end of a transaction. A holdable cursor, or result set, is one that does not automatically close when the transaction that contains the cursor is committed. You may improve database performance by including the ResultSet holdability. If ResultSet objects are closed when a commit operation is implicitly or explicitly called, this can also improve performance.
According to Java Database Connectivity, Version 3.0:
When the method Connection.commit is called, open ResultSet objects that have been created during the current transaction are closed.With ResultSet holdability, it is possible to exercise greater control on when the ResultSet objects are closed when the commit operation is performed. Using the ResultSet holdability, ResultSet objects that are closed when a commit operation is performed can result in better performance in some applications.
To specify the holdability of a ResultSet object, you must do so when preparing a java.sql.Statement (or java.s ql. Prepared Statement or java. sql. Callable Statement) using the Connection. create Statement(), Connection. prepare Statement(), or Connection. prepareCall() method. The ResultSet holdability may be one of the following constants (defined in the ResultSet interface):
In general, closing a cursor(as a ResultSet object) when a transaction is committed results in better performance.
JDBC Related Interview Questions
|Core Java Interview Questions||JSP Interview Questions|
|Java Servlets Interview Questions||EJB(Enterprise JavaBeans) Interview Questions|
|JSTL(JSP Standard Tag Library) Interview Questions||JNDI (Java Naming and Directory Interface) Interview Questions|
|Java Bean Utils Interview Questions||AWT (Abstract Window Toolkit) Interview Questions|
What Is Jdbc Programming?
Database Metadata, Part 1
Database Metadata, Part 2
Exploring Driver Property Information
Rowset Metadata A
Web Access To Metadata,part 1
Web Access To Metadata, Part 2
Rdf And Jdbc Metadata
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.