JDBC Articles

Found 220 articles

Setting up a JDBC connection to remote SAP HANA system

Manikanth Mani
Manikanth Mani
Updated on 13-Mar-2026 1K+ Views

To establish a JDBC connection to a remote SAP HANA system, you need to configure the correct port number and use the appropriate JDBC driver. Port Configuration You are using the correct port number for instance number "00". Port number 30015, where 00 represents the instance number of your HANA system. The port format follows the pattern 315 for SQL connections. JDBC Driver Setup Use the HANA client JAR file ngdbc.jar instead of the generic SAP JAR file. This driver is specifically optimized for HANA database connections and provides better performance and compatibility. Example ...

Read More

Java DatabaseMetaData getURL() method with example

Alshifa Hasnain
Alshifa Hasnain
Updated on 06-Mar-2025 572 Views

In this article, we will learn about the DatabaseMetaData getURL() method in Java. The DatabaseMetaData interface provides useful methods to obtain details about the database and the JDBC driver. One such method is getURL(), which returns the URL of the JDBC driver being used. What is the getURL() Method? The getURL() method in Java's DatabaseMetaData interface is used to retrieve the URL of the database to which the current connection is established. Syntax String dbUrl = metaData.getURL(); This method retrieves the URL of the underlying Database Management System and returns it in the form of a String variable. ...

Read More

Java ResultSetMetaData getScale() method with example

Alshifa Hasnain
Alshifa Hasnain
Updated on 27-Feb-2025 589 Views

In this article, we will learn the ResultSetMetaData getScale() method in Java. The ResultSetMetaData interface provides metadata about the columns in a ResultSet object. The getScale() method returns the number of digits to the right of the decimal point for a specified column. What is the getScale() method? The getScale() method of the ResultSetMetaData (interface) retrieves the number of digits after the right of the decimal point in the given column. This method accepts an integer value representing the index of a column. and returns an integer value representing the number of digits after the decimal in the specified column. Syntax ...

Read More

Java DatabaseMetaData getDriverName() method with example

Alshifa Hasnain
Alshifa Hasnain
Updated on 27-Feb-2025 492 Views

In this article, we will learn about the DatabaseMetaData getDriverName() method in Java. The DatabaseMetaData interface provides useful methods to obtain details about the database and the JDBC driver. One such method is getDriverName(), which returns the name of the JDBC driver being used. What is getDriverName() in Java? The getDriverName() method belongs to the DatabaseMetaData interface in Java's JDBC API. It retrieves the name of the JDBC driver currently connected to the database. Syntax String driver_name = metaData.getDriverName(); The method returns the following values − Returns a String representing the name of the ...

Read More

Java DatabaseMetaData getProcedures() method with example

Alshifa Hasnain
Alshifa Hasnain
Updated on 24-Feb-2025 764 Views

In this article, we will learn the DatabaseMetaData getProcedures() method in Java. In Java, the DatabaseMetaData.getProcedures() method is used to retrieve information about stored procedures available in a database. What is getProcedures()? The getProcedures() method of the DatabaseMetaData interface returns a ResultSet containing metadata about stored procedures available in a database. This allows developers to query the database for procedure names, catalog information, procedure types, and specific names. Syntax ResultSet procedures = metaData.getProcedures(null, null, "myprocedure"); This method retrieves the description of the stored procedures of a database/catalog. It accepts 3 parameters − catalog: The catalog name ...

Read More

Java ResultSetMetaData getColumnLabel() method with example

Alshifa Hasnain
Alshifa Hasnain
Updated on 20-Feb-2025 859 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

Java DatabaseMetaData getIndexInfo() method with example

Alshifa Hasnain
Alshifa Hasnain
Updated on 17-Feb-2025 1K+ Views

In this article, we will learn about the DatabaseMetaData getIndexInfo() method with an example in Java. This is useful when you need to understand the display information of a table in a result set using the indexes. DatabaseMetaData getIndexInfo() method The getIndexInfo() method in Java’s DatabaseMetaData interface retrieves information about indexes for a specified table in a database. This method is useful for understanding the structure and performance of a database table, particularly for optimization and query tuning. Syntax ResultSet rs = metaData.getIndexInfo("example_database", null, "sample_table", false, false); This method retrieves the description of the indices of a table. It accepts ...

Read More

Java ResultSetMetaData getPercision() method with example

Rishi Raj
Rishi Raj
Updated on 10-Feb-2025 509 Views

In this article, we will learn how to retrieve the size of a specified column in a ResultSet object using the getPrecision() method of the ResultSetMetaData interface in JDBC. What does getPrecision() in ResultSetMetaData do? The getPercision() method of the ResultSetMetaData (interface) retrieves the size of the specified column in the current ResultSet object. This method accepts an integer value representing the index of a column and, returns an integer value representing the size of the given column. Steps to get the ResultSetMetaData object To get the ResultSetMetaData object, you need to − Step 1. Register ...

Read More

Java ResultSetMetaData getColumnDisplaySize() Method with Example

Alshifa Hasnain
Alshifa Hasnain
Updated on 28-Jan-2025 708 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

Java ResultSet getType() Method with Example

Arushi
Arushi
Updated on 28-Jan-2025 1K+ Views

In JDBC (Java Database Connectivity), the ResultSet interface represents the result set of a database query in Java. One of the important methods provided by ResultSet is getType(), which returns the type of the ResultSet object. Result getType() method The getType() method is used to determine the type of cursor and its behavior when scrolling through the result set.Syntax of getType() int resultSet_Type = rs.getType(); This method returns an integer value that corresponds to one of the ResultSet type constants. These constants indicate the type of cursor used by the ResultSet: ResultSet.TYPE_FORWARD_ONLY (value: 1003): This ...

Read More
Showing 1–10 of 220 articles
« Prev 1 2 3 4 5 22 Next »
Advertisements