Vikyath Ram has Published 138 Articles

Java Connection commit() method with example

Vikyath Ram

Vikyath Ram

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

7K+ Views

The commit() method of the Connection interface saves all the modifications made since the last commit.con.save()If any issue occurs after the commit you can revert all the changes done till this commit by invoking the rollback() method.Con.rollback()To commit a transactionRegister the driver using the registerDriver() method of the DriverManager class as −//Registering the Driver DriverManager.registerDriver(new ... Read More

Java Connection getNumeric() method with example

Vikyath Ram

Vikyath Ram

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

213 Views

The getNumeric() method of the Connection interface retrieves the list of math functions supported by the current database. The names returned by this method are the Open CLI math function names.This method returns a String value holding the list of functions separated by commas (", ").To get the list of the numeric ... Read More

Java Connection getStringFunctions() method with example

Vikyath Ram

Vikyath Ram

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

285 Views

The getStringFunctions() method of the Connection interface retrieves the list of String functions supported by the current database. The names returned by this method are the Open CLI String function names.This method returns a String value holding the list of functions separated by commas (", ").To get the list of ... Read More

Java Connection getSystemFunctions() method with example

Vikyath Ram

Vikyath Ram

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

145 Views

This method retrieves the list of System functions supported by the current database. The names returned by this method are the Open CLI System function names.This method returns a String value holding the list of functions separated by commas (", ").To get the list of the System functions supported by ... Read More

Java DatabaseMetaData getSearchStringEscape() method with example

Vikyath Ram

Vikyath Ram

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

170 Views

The getSearchStringEscape() method of the DatabaseMetaData interface is used to get the that is used to escape the wildcard characters ('_' or, '%') by the underlying database.This method returns a string parameter representing the value that is used to escape wildcard charactersTo get the DatabaseMetaData object −Make sure your database is up ... Read More

Java ResultSet isClosed() method with example

Vikyath Ram

Vikyath Ram

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

431 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 move the ResultSet cursor to the next row in JDBC?

Vikyath Ram

Vikyath Ram

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 of the ... Read More

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

Vikyath Ram

Vikyath Ram

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

5K+ 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 to get the list of all databases using JDBC?

Vikyath Ram

Vikyath Ram

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

3K+ Views

You can get the list of databases in MySQL using the SHOW DATABASES query.show databases;Following JDBC program retrieves the list of databases by executing the show databases query.Exampleimport java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; public class ShowDatabasesExample {    public static void main(String args[]) throws Exception {     ... Read More

How to get column count in a ResultSet in JDBC?

Vikyath Ram

Vikyath Ram

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

6K+ Views

You can get the column count in a table using the getColumnCount() method of the ResultSetMetaData interface. On invoking, this method returns an integer representing the number of columns in the table in the current ResultSet object.//Retrieving the ResultSetMetaData object ResultSetMetaData rsmd = rs.getMetaData(); //getting the column type int column_count = rsmd.getColumnCount();Let us ... Read More

Advertisements