Get Value From Resultset Java. GetString1 will get you the value of first column in your select query. Java Code Examples for javasqlResultSetgetBoolean The ResultSet interface provides getter methods getBoolean getLong and so on A ResultSet object is automatically closed when the Statement object that The ResultSet interface declares getter methods for example getBoolean and getLong for retrieving column values from the current row.
GetString1 will get you the value of first column in your select query. The column index is usually more efficient. Retrieve an aggregated SQL value from a ResultSet in Java.
If you Do Not Know the Name Position and Type of Each Column how to get value from ResultSet.
Below java code shows how to get or retrieve column values from Resultset. Reader getCharacterStreamint columnIndex This method is used to get the character stream value as javaioReader object from the specified column index of the current row. In the result set loop use the integer variable names in the GETSET methods. If you Do Not Know the Name Position and Type of Each Column how to get value from ResultSet.