com.interface21.jdbc.core
Class DefaultColumnExtractor
java.lang.Object
|
+--com.interface21.jdbc.core.DefaultColumnExtractor
- All Implemented Interfaces:
- ColumnExtractor
- public class DefaultColumnExtractor
- extends java.lang.Object
- implements ColumnExtractor
Default implementation of the ColumnExtractor interface. Tested
in Oracle 8 and Access. As it isn't a critical part of the
JDBC framework in this package, it has not been tested more rigorously.
- Since:
- May 2, 2001
- Author:
- Rod Johnson
|
Method Summary |
java.lang.Object |
extractColumn(int i,
java.lang.Class requiredType,
java.sql.ResultSet rs)
Extract the given column from this row of the given ResultSet, ensuring that the
returned object is of the required type. |
java.lang.Object |
extractColumn(java.lang.String columnName,
java.lang.Class requiredType,
java.sql.ResultSet rs)
Extract the given column from this row of the given ResultSet, ensuring that the
returned object is of the required type.
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultColumnExtractor
public DefaultColumnExtractor()
extractColumn
public java.lang.Object extractColumn(java.lang.String columnName,
java.lang.Class requiredType,
java.sql.ResultSet rs)
throws java.sql.SQLException
- Extract the given column from this row of the given ResultSet, ensuring that the
returned object is of the required type.
This implementation works on Oracle 8 and Access.
- Specified by:
extractColumn in interface ColumnExtractor
- Parameters:
columnName - name of the column we want from the ResultSetrequiredType - class of object we must returnrs - ResultSet to extract the column value from- Returns:
- the value of the specified column in the ResultSet as an instance of the
required type
- Throws:
java.sql.SQLException - if there is any problem getting this column value
extractColumn
public java.lang.Object extractColumn(int i,
java.lang.Class requiredType,
java.sql.ResultSet rs)
throws java.sql.SQLException
- Extract the given column from this row of the given ResultSet, ensuring that the
returned object is of the required type. Should implement the same conversion
as extractColumn(columnName...).
- Specified by:
extractColumn in interface ColumnExtractor
- Parameters:
i - index (from 1) of the column we want from the ResultSetrequiredType - class of object we must returnrs - ResultSet to extract the column value from- Returns:
- the value of the specified column in the ResultSet as an instance of the
required type
- Throws:
java.sql.SQLException - if there is any problem getting this column value. Implementations
of this interface do not need to worry about handling such exceptions; they can
assume they will only be called by code that correctly cleans up after any SQLExceptions
Rod Johnson and Spring contributors 2001-2003.