|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.storage.jdbc.JDBCColumnValuesAdapter
public abstract class JDBCColumnValuesAdapter
The purpose of the JDBCColumnValuesAdapter is to optionally allow multiple JDBC column values from a result set row to be returned as a single Object by JDBC adapters.
If the setRetrieveAllColumnValues
property is set to true, then the adapter will get all of the column values
for the requested row index in the form of a Map containing the column names (all uppercased) mapped to the column values.
If a column values transform has been specified, via the setColumnValuesTransform
method,
the adapter will use it to trasform the Map values into a single Object, otherwise the Map itself will be returned.
If the setRetrieveAllColumnValues
property is set to false, then a single column value
is returned. See the documentation in subclasses of the JDBCColumnValuesAdapter for more information about which column
value is returned.
Field Summary | |
---|---|
protected com.sas.util.transforms.TransformInterface |
columnValuesTransform
Transform used to transform a Map, containing column names (all uppercased) mapped to column values, to a single Object when retrieveAllColumnValues is true |
protected boolean |
retrieveAllColumnValues
Indicates if the adapter will retrieve all of the column values for a particular row index in the result set in the form of a Map |
Fields inherited from class com.sas.storage.jdbc.JDBCAdapter |
---|
autoCommit, CLASS_NAME, columnInfoUsed, conn, designTime, displayTransform, forwardOnly, initialized, isRowCountKnown, LABEL, meta, NAME, printWarnings, queryRowCountDisabled, queryStatement, RB_KEY, readOnly, result, resultSetRequeryUsed, resultSetType, resultSetUsed, retrieveNumericTypesAsDouble, rowCount, rowCountQueryString, rowNumber, spcs, stmt, trimUsed |
Constructor Summary | |
---|---|
JDBCColumnValuesAdapter(java.sql.Connection conn,
java.lang.String queryStatement)
Constructor used to create an initialized adapter. |
|
JDBCColumnValuesAdapter(java.sql.ResultSet result)
Constructor used to connect an adapter directly to a previously created ResultSet. |
Method Summary | |
---|---|
protected java.util.Map |
getColumnValuesMap(java.sql.ResultSet resultSet)
Returns a Map containing the column names (all uppercased) mapped to the column values from the current row in the result set. |
com.sas.util.transforms.TransformInterface |
getColumnValuesTransform()
Returns the transform used to transform a Map, containing column names (all uppercased) mapped to column values, to a single Object. |
boolean |
isRetrieveAllColumnValues()
if true, indicates the adapter will retrieve all of the column values for a particular row in the result set in the form of a Map, mapping column names (all uppercased) to column values. |
protected java.lang.Object |
retrieveColumnValueAt(int col,
java.sql.ResultSet result)
Returns the column value from the current row in the specified result set. |
protected java.lang.Object |
retrieveValueAt(int col,
java.sql.ResultSet resultSet)
If the setRetrieveAllColumnValues property is set to true, then the adapter will get all of the column values
at the current cursor position in the result set in the form of a Map, mapping column names (all uppercased) to column values. |
void |
setColumnValuesTransform(com.sas.util.transforms.TransformInterface transform)
Sets the transform used to transform a Map, containing column names (all uppercased) mapped to column values, to a single Object. |
void |
setRetrieveAllColumnValues(boolean value)
If set to true, the adapter will retrieve all of the column values for a particular row in the result set in the form of a Map, mapping column names (all uppercased) to column values. |
Field Detail |
---|
protected com.sas.util.transforms.TransformInterface columnValuesTransform
protected boolean retrieveAllColumnValues
Constructor Detail |
---|
public JDBCColumnValuesAdapter(java.sql.ResultSet result)
result
- ResultSet to use.public JDBCColumnValuesAdapter(java.sql.Connection conn, java.lang.String queryStatement)
conn
- A java.sql.Connection
object.queryStatement
- A SQL query that is valid for the database
represented by conn
.Method Detail |
---|
public void setRetrieveAllColumnValues(boolean value)
columnValuesTransform
has been specified, the adapter will use it
to transform the Map, otherwise the Map itself will be returned. If false, then a single column value is returned as determined
by subclasses of this adapter.
value
- indicates if the adapter will retrieve all of the column values for a row in the result set in the form of a Mappublic boolean isRetrieveAllColumnValues()
public void setColumnValuesTransform(com.sas.util.transforms.TransformInterface transform)
setRetrieveAllColumnValues
property is set to true.
public com.sas.util.transforms.TransformInterface getColumnValuesTransform()
setRetrieveAllColumnValues
property is set to true.
protected java.lang.Object retrieveValueAt(int col, java.sql.ResultSet resultSet) throws java.sql.SQLException
setRetrieveAllColumnValues
property is set to true, then the adapter will get all of the column values
at the current cursor position in the result set in the form of a Map, mapping column names (all uppercased) to column values.
If a columnValuesTransform
has been specified, the adapter uses it to transform the Map, otherwise the Map itself
is returned.
If the setRetrieveAllColumnValues
property is set to false, then the column value at the specified column index
is returned from the current cursor position in the result set.
retrieveValueAt
in class JDBCAdapter
col
- A one-based index that identifies a column in the result set.resultSet
- the ResultSet from which to retrieve the values.
java.sql.SQLException
- thrown if ResultSet throws an SQLException.protected java.util.Map getColumnValuesMap(java.sql.ResultSet resultSet) throws java.sql.SQLException
java.sql.SQLException
protected java.lang.Object retrieveColumnValueAt(int col, java.sql.ResultSet result) throws java.sql.SQLException
col
- A one-based index that identifies the result set column.result
- ResultSet from which to get values.
java.sql.SQLException
- thrown if ResultSet throws a SQLException.
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |