Arushi has Published 141 Articles

What is ResultSet holdability in JDBC?

Arushi

Arushi

Updated on 30-Jul-2019 22:30:26

2K+ Views

ResultSet holdability determines whether the ResultSet objects (cursors) should be closed or held open when a transaction (that contains the said cursor/ ResultSet object) is committed using the commit() method of the Connection interface.You can set the ResultSet holdability using the setHoldability() method of the Connection interface.con.setHoldability(ResultSet.CLOSE_CURSORS_AT_COMMIT);The ResultSet interface provides ... Read More

Java Connection getHoldability() method with example

Arushi

Arushi

Updated on 30-Jul-2019 22:30:26

322 Views

ResultSet holdability determines whether the ResultSet objects (cursors) should be closed or held open when a transaction (that contains the said cursor/ResultSet object) is committed using the commit() method of the Connection interface.The getHoldability() method of the Connection interface is used to retrieves and returns the current holdability value of the ResultSet ... Read More

Java Connection releaseSavepoint() method with example

Arushi

Arushi

Updated on 30-Jul-2019 22:30:26

461 Views

A save point is a logical rollback point within a transaction. When you set a save point, whenever an error occurs past a save point, you can undo the events you have done up to the created save point using the rollback() method.You can set a save point in a ... Read More

The DatabaseMetaData getResultSetHoldability() method with example

Arushi

Arushi

Updated on 30-Jul-2019 22:30:26

149 Views

ResultSet holdability determines whether the ResultSet objects (cursors) should be closed or held open when a transaction (that contains the said cursor/ResultSet object) is committed using the commit() method of the Connection interface.The getResultSetHoldability() method of the DatabaseMetaData interface retrieves the default holdability for the ResultSet objects of the underlying database.This ... Read More

Java ResultSet isBeforeFirst() method with example

Arushi

Arushi

Updated on 30-Jul-2019 22:30:26

3K+ Views

When we execute certain SQL queries (SELECT query in general) they return tabular data.The java.sql.ResultSet interface represents such tabular data returned by the SQL statements.i.e. the ResultSet object holds the tabular data returned by the methods that execute the statements which quires the database (executeQuery() method of the Statement interface in general).The ... Read More

How to retrieve the contents of a ResultSet from last to first in JDBC?

Arushi

Arushi

Updated on 30-Jul-2019 22:30:26

676 Views

ResultSet objectCertain SQL queries (especially SELECT) returns tabular data, In JDBC the object of the java.sql.ResultSet interface holds the tabular data returned by the methods that execute the statements which quires the database (executeQuery() method of the Statement interface in general).ResultSet Cursor/pointerThe ResultSet object has a cursor/pointer which points to ... Read More

How to move the ResultSet cursor to the last row in JDBC?

Arushi

Arushi

Updated on 30-Jul-2019 22:30:26

1K+ Views

Whenever we execute SQL statements using the executeQuery() method, it returns a ResultSet object which holds the tabular data returned by the SELECT queries (in general).The ResultSet object contains a cursor/pointer which points to the current row. Initially this cursor is positioned before first row (default position).You can move the cursor ... Read More

How do you check if a ResultSet is closed or not in JDBC?

Arushi

Arushi

Updated on 30-Jul-2019 22:30:26

2K+ Views

Whenever we execute SQL statements using the executeQuery() method, it returns a ResultSet object which holds the tabular data returned by the SELECT queries(in general).The ResultSet object contains a cursor/pointer which points to the current row. Initially this cursor is positioned before first row (default position).The isClosed() method of the ResultSet interface ... Read More

How to get all table names from a database using JDBC?

Arushi

Arushi

Updated on 30-Jul-2019 22:30:26

8K+ Views

You can get the list of tables in the current database in MySQL using the SHOW TABLES query.Show tables;Following JDBC program retrieves the list of tables in the database by executing the show tables query.Exampleimport java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; public class ListingTables {    public static void ... Read More

How to Maintain an open ResultSet after commit in JDBC?

Arushi

Arushi

Updated on 30-Jul-2019 22:30:26

673 Views

ResultSet holdability determines whether the ResultSet objects (cursors) should be closed or held open when a transaction (that contains the said cursor/ ResultSet object) is committed using the commit() method of the Connection interface.ResultSet interface provides two values to specify the holdability namely CLOSE_CURSORS_AT_COMMIT and HOLD_CURSORS_OVER_COMMITIf the holdability of the ... Read More

Previous 1 ... 7 8 9 10 11 ... 15 Next
Advertisements