
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 317 Articles for JDBC

251 Views
In general a catalog is a directory which holds information about data sets, file or, a database. Whereas, in a database, catalog holds the list of all the databases, base tables, views (virtual tables), synonyms, value ranges, indexes, users, and user groups.The getCatalogName() method of the ResultSetMetaData (interface) retrieves the name of the catalog of the table containing a particular column.This method accepts an integer value representing the index of the column in the current ResultSet object, as an argument and, returns a String value representing the name of the catalog.To get the ResultSetMetaData object, you need to −Register the Driver: Select the ... Read More

610 Views
In this article, we will learn the ResultSetMetaData getColumnDisplaySize() method with an example in Java. This is useful when you need to understand the display requirements of a column in a result set. Method Signature The getColumnDisplaySize(int column) method of the ResultSetMetaData class in Java retrieves the maximum width of the specified column, measured in characters. int getColumnDisplaySize(int column) Parameters: The 1-based index of the column for which you want the display size. Returns: The maximum number of characters that can be displayed for the specified column. ... Read More

697 Views
In this article, we will learn the ResultSetMetaData getColumnLabel() method in Java. When working with databases in Java, the ResultSetMetaData interface provides valuable information about the structure of a ResultSet, such as column names, types, and properties. What is getColumnLabel()? The getColumnLabel() method of the ResultSetMetaData (interface) retrieves the display name of a particular column. This method accepts an integer value representing the index of the column in the current ResultSet object, as an argument. Syntax − String columnLabel = resultSetMetaData.getColumnLabel(); Parameters: The index of the column (starting from 1). Returns: A ... Read More

1K+ Views
The getColumnCount() method of the ResultSetMetaData (interface) retrieves the number of the columns of the current ResultSet object.This method returns an integer value representing the number of columns.To get the ResultSetMetaData object, you need to:Register the Driver: Select the required database register the Driver class of the particular database using the registerDriver() method of the DriverManager class or, the forName() method of the class named Class.DriverManager.registerDriver(new com.mysql.jdbc.Driver());Get connection: Create a connection object by passing the URL of the database, username and password of a user in the database (in string format) as parameters to the getConnection() method of the DriverManager class.Connection mysqlCon = ... Read More

8K+ 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 wasNull() method of the ResultSet interface determines whether the last column read had a Null value. i.e. whenever you read the contents of a column of the ResultSet using the ... Read More

2K+ 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 updateRow() method of the ResultSet interface updates the contents of the current row to the database. For example if we have updated the values of a particular record using the updateXXX() ... Read More

940 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 relative() method of the ResultSet interface moves the ResultSet pointer/cursor n number of rows from the current position.This method returns an integer value representing the current row number to which the ResultSet pointer ... Read More

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 afterLast() method of the ResultSet interface moves the pointer/cursor of the current ResultSet object to next position of the last row.rs.afterLast();Let us create a table with name MyPlayers in MySQL ... Read More

4K+ 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 beforeFirst() method of the ResultSet interface moves the pointer of the current (ResultSet) object to the default position (before first), from the current position.Statement stmt = con.createStatement(); ResultSet rs = ... Read More

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 ResultSet object has a cursor/pointer which points to the current row. Initially this cursor is positioned before first row.The deleteRow() method of the ResultSet interface deletes the current row from the ResultSet object and from the table.rs.deleteRow();Let us create a table with name MyPlayers in MySQL database using CREATE statement as ... Read More