Found 317 Articles for JDBC

Java ResultSet next() method with example

Arushi
Updated on 31-May-2024 13:53:59

21K+ 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 ResultSet object has a cursor/pointer which points to the current row. Initially this cursor is positioned before first row.The next() method of the ResultSet interface moves the pointer of the current (ResultSet) object to the next row, from the current position.Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("Select ... Read More

Java DatabaseMetaData getMaxSchemaNameLength() method with example.

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

28 Views

The getMaxSchemaNameLength() method of the DatabaseMetaData interface is used to find out the maximum number of characters that the underlying database allows in the name of a schema.This method returns an integer value, representing the maximum number of characters allowed in a schema name. If this value is 0 it indicates that there is no limit or, limit is unknown.To get the DatabaseMetaData object −Make sure your database is up and running.Register the driver using the registerDriver() method of the DriverManager class. Pass an object of the driver class corresponding to the underlying database.Get the connection object using the getConnection() ... Read More

Java DatabaseMetaData getMaxCursorNameLength() method with example.

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

32 Views

The getMaxCursorNameLength() method of the DatabaseMetaData interface is used to find out the maximum number of characters that the underlying database allows in the name of a cursor.This method returns an integer value, representing the maximum number of characters allowed in a cursor name. If this value is 0 it indicates that there is no limit or, limit is unknown.To get the DatabaseMetaData object −Make sure your database is up and running.Register the driver using the registerDriver() method of the DriverManager class. Pass an object of the driver class corresponding to the underlying database.Get the connection object using the getConnection() ... Read More

Java DatabaseMetaData getMaxCatalogNameLength() method with example.

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

15 Views

The getMaxCatalogNameLength() method of the DatabaseMetaData interface is used to find out the maximum number of characters that the underlying database allows in the name of a catalog.This method returns an integer value, representing the maximum number of characters allowed in a catalog name. If this value is 0 it indicates that there is no limit or, limit is unknown.To get the DatabaseMetaData object −Make sure your database is up and running.Register the driver using the registerDriver() method of the DriverManager class. Pass an object of the driver class corresponding to the underlying database.Get the connection object using the getConnection() ... Read More

Java ResultSet previous() method with example

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

1K+ 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 ResultSet object has a cursor/pointer which points to the current row. Initially this cursor is positioned before first row.The previous() method of the ResultSet interface moves the pointer of the current (ResultSet) object to the previous row, from the current position.This method returns a boolean value specifying whether ... Read More

Java DatabaseMetaData getMaxTablesInSelect() method with example.

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

23 Views

The getMaxTablesInSelect() method of the DatabaseMetaData interface is used to find out the maximum number of tables that the underlying database allows in an SQL SELECT statement.This method returns an integer value, representing the maximum number of tables allowed in a SELECT statement. If this value is 0 it indicates that there is no limit or, limit is unknown.To get the DatabaseMetaData object −Make sure your database is up and running.Register the driver using the registerDriver() method of the DriverManager class. Pass an object of the driver class corresponding to the underlying database.Get the connection object using the getConnection() method ... Read More

Java DatabaseMetaData getUserName() method with example

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

851 Views

This method retrieves the user name used to establish the current connection −To retrieve the user name as known to the database −Make sure your database is up and running.Register the driver using the registerDriver() method of the DriverManager class. Pass an object of the driver class corresponding to the underlying database.Get the connection object using the getConnection() method of the DriverManager class. Pass the URL the database and, user name, password of a user in the database, as String variables.Get the DatabaseMetaData object with respect to the current connection using the getMetaData() method of the Connection interface.Finally, retrieve the ... Read More

Java DatabaseMetaData getURL() method with example

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

305 Views

This method retrieves the URL of the underlying Database Management System and returns in the form of a String variable.To get the list URL of the underlying DBMS −Make sure your database is up and running.Register the driver using the registerDriver() method of the DriverManager class. Pass an object of the driver class corresponding to the underlying database.Get the connection object using the getConnection() method of the DriverManager class. Pass the URL the database and, user name, password of a user in the database, as String variables.Get the DatabaseMetaData object with respect to the current connection using the getMetaData() method ... Read More

Java DatabaseMetaData getTables() method with example

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

3K+ Views

This method retrieves the description of the tables available in the specified database/catalog. It accepts 4 parameters −catalog   − A string parameter representing the name (or, name pattern) of the catalog (database in general) in which the table (that contains the columns of which you need to retrieve the description about) exists. pass "" to get the description of the columns in tables with no catalog and, pass null if you don't want to use catalog and thus narrow the search.schemaPattern  − A String parameter representing the name (or, name pattern) of the schema of the table, pass "" ... Read More

Java DatabaseMetaData getMaxStatements() method with example.

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

56 Views

The getMaxStatements() method of the DatabaseMetaData interface is used to find out the maximum number of open statements (objects) that the underlying database allows at one time.This method returns an integer value, representing the maximum number of statements that are allowed to be open at a time. If this value is 0 it indicates that there is no limit or, limit is unknown.To get the DatabaseMetaData object −Make sure your database is up and running.Register the driver using the registerDriver() method of the DriverManager class. Pass an object of the driver class corresponding to the underlying database.Get the connection object ... Read More

Advertisements