ads/auto.txt

Java Resultset Has Column

Java Resultset Has Column. According to the JDK docs the integer returned corresponds to generic SQL data. Its quick easy.

Jdbc Resultsetmetadata Demo Pattern Design Demo Design
Jdbc Resultsetmetadata Demo Pattern Design Demo Design from www.pinterest.com

The ResultSet interface provides getter methods getBoolean getLong and so on for retrieving column values from the current row. Using this you can find the index of a particular column in the result set. In general using the column index will be more efficient.

According to the JDK docs the integer returned corresponds to generic SQL data.

Be aware that getColumnType just returns an integer so youll need to know what that integer means. Thats correct initially the ResultSet s cursor is pointing to before the first row if the first call to next returns false then there was no data in the ResultSet. You should use the ResultSetMetaData getColumnType and getColumnTypeName methods to determine the data type of a column of information returned in a ResultSet. Also you can obtain the resultsets metadata which will allow you to determine how many columns are in each row and their names.