8.5.7 findColumn(String columnName)
- Organization of this subsection
(1) Function
This method returns the column number corresponding to a specified column name.
(2) Format
public synchronized int findColumn(String columnName) throws SQLException
(3) Arguments
- String columnName
-
Specifies a column name. The column number corresponding to this column name is returned.
The following notes apply to specifying a column name:
-
Column names are not case sensitive.
-
Because the entire character string that is specified is assumed to be the column name, any double quotation mark (") specified in the character string is assumed to be part of the column name.
-
If more than one column has the specified column name, the smallest column number corresponding to that column name is returned.
-
(4) Return value
This method returns the column number corresponding to the specified column name.
(5) Exceptions
The JDBC driver throws an SQLException in the following cases:
-
This ResultSet object is closed.
This includes the case where the ResultSet object was closed because the Statement object that created this ResultSet object was closed.
-
The Connection used to create the Statement object that created this ResultSet object has been closed.
-
The ResultSet object was invalidated by transaction settlement.
-
A nonexistent column name was specified.
-
null or a character string with a length of zero was specified for columnName.