com.sas.storage.jdbc
Class JDBCDataAccessor

com.sas.storage.jdbc.JDBCDataAccessor

public class JDBCDataAccessor


Field Summary
protected  java.sql.Connection dataSource
           
protected  java.util.HashMap propertyMap
           
static int PROPERTYMAP_COLUMN_INDEX
           
static int PROPERTYMAP_COLUMN_NAME
           
static int PROPERTYMAP_COLUMN_TYPE
           
static int PROPERTYMAP_JDBCDATAACCESSOR_FUTURES
           
static int PROPERTYMAP_PROPERTY_NAME
           
static int PROPERTYMAP_USERBASE
           
protected  java.lang.String queryStatement
           
static java.lang.String RB_KEY
           
protected  java.sql.ResultSet results
           
protected  java.sql.Statement secondaryStatement
           
protected  java.sql.Statement statement
           
protected  java.lang.String updateStatement
           
 
Constructor Summary
JDBCDataAccessor()
           
JDBCDataAccessor(java.sql.Connection dataSource)
           
JDBCDataAccessor(java.sql.Connection dataSource, java.lang.String queryStatement)
           
JDBCDataAccessor(java.sql.Connection dataSource, java.lang.String queryStatement, java.lang.String updateStatement)
           
 
Method Summary
 void close()
           
 void executeQuery()
           
 void executeQuery(java.lang.String queryStatement)
           
 int executeUpdate()
           
 int executeUpdate(java.lang.String updateStatement)
           
protected  java.lang.Object getColumnValue(int columnType, int columnIndex)
           
 java.sql.Connection getDataSource()
           
 java.util.HashMap getPropertyMap()
           
 java.lang.String getQueryStatement()
           
 java.sql.ResultSet getResults()
           
 java.lang.Object[][] getRowValues()
          Gets an entire row of column values in a two-dimensional array with names as first dimension.
 java.lang.Object[] getRowValues(java.lang.String[] columns)
           
 java.sql.Statement getSecondaryStatement()
           
 java.sql.Statement getStatement()
           
 java.lang.String getUpdateStatement()
           
 void init()
           
 void init(int resultSetType, int resultSetConcurrency)
           
 void resubmitQuery()
           
protected  void setColumnInfo(java.lang.Object[] columnInfo)
           
 void setDataSource(java.sql.Connection dataSource)
           
 void setPropertyMap(java.util.HashMap propertyMap)
           
 void setPropertyMap(java.lang.Object[][] propertyMap)
           
 void setQueryStatement(java.lang.String queryStatement)
           
 void setResults(java.sql.ResultSet results)
           
 void setRowValues(java.lang.Object[][] values)
           
 void setRowValues(java.lang.String[] columns, java.lang.Object[] values)
           
 void setSecondaryStatement(java.sql.Statement secondaryStatement)
           
 void setStatement(java.sql.Statement statement)
           
 void setUpdateStatement(java.lang.String updateStatement)
           
protected  void updateColumn(int columnIndex, int columnType, java.lang.Object value)
           
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values

dataSource

protected java.sql.Connection dataSource

statement

protected java.sql.Statement statement

secondaryStatement

protected java.sql.Statement secondaryStatement

results

protected java.sql.ResultSet results

propertyMap

protected java.util.HashMap propertyMap

queryStatement

protected java.lang.String queryStatement

updateStatement

protected java.lang.String updateStatement

PROPERTYMAP_PROPERTY_NAME

public static int PROPERTYMAP_PROPERTY_NAME

PROPERTYMAP_COLUMN_NAME

public static int PROPERTYMAP_COLUMN_NAME

PROPERTYMAP_COLUMN_TYPE

public static int PROPERTYMAP_COLUMN_TYPE

PROPERTYMAP_COLUMN_INDEX

public static int PROPERTYMAP_COLUMN_INDEX

PROPERTYMAP_JDBCDATAACCESSOR_FUTURES

public static int PROPERTYMAP_JDBCDATAACCESSOR_FUTURES

PROPERTYMAP_USERBASE

public static int PROPERTYMAP_USERBASE
Constructor Detail

JDBCDataAccessor

public JDBCDataAccessor()

JDBCDataAccessor

public JDBCDataAccessor(java.sql.Connection dataSource)

JDBCDataAccessor

public JDBCDataAccessor(java.sql.Connection dataSource,
                        java.lang.String queryStatement)

JDBCDataAccessor

public JDBCDataAccessor(java.sql.Connection dataSource,
                        java.lang.String queryStatement,
                        java.lang.String updateStatement)
Method Detail

setDataSource

public void setDataSource(java.sql.Connection dataSource)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getDataSource

public java.sql.Connection getDataSource()

setStatement

public void setStatement(java.sql.Statement statement)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

getStatement

public java.sql.Statement getStatement()

setSecondaryStatement

public void setSecondaryStatement(java.sql.Statement secondaryStatement)
                           throws java.sql.SQLException
Throws:
java.sql.SQLException

getSecondaryStatement

public java.sql.Statement getSecondaryStatement()

setResults

public void setResults(java.sql.ResultSet results)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

getResults

public java.sql.ResultSet getResults()

setQueryStatement

public void setQueryStatement(java.lang.String queryStatement)

getQueryStatement

public java.lang.String getQueryStatement()

setUpdateStatement

public void setUpdateStatement(java.lang.String updateStatement)

getUpdateStatement

public java.lang.String getUpdateStatement()

getPropertyMap

public java.util.HashMap getPropertyMap()

setPropertyMap

public void setPropertyMap(java.util.HashMap propertyMap)
                    throws java.sql.SQLException
Throws:
java.sql.SQLException

setPropertyMap

public void setPropertyMap(java.lang.Object[][] propertyMap)
                    throws java.sql.SQLException
Throws:
java.sql.SQLException

init

public void init(int resultSetType,
                 int resultSetConcurrency)
          throws java.sql.SQLException
Throws:
java.sql.SQLException

init

public void init()
          throws java.sql.SQLException
Throws:
java.sql.SQLException

executeQuery

public void executeQuery()
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

executeQuery

public void executeQuery(java.lang.String queryStatement)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

executeUpdate

public int executeUpdate()
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

executeUpdate

public int executeUpdate(java.lang.String updateStatement)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

resubmitQuery

public void resubmitQuery()
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

setRowValues

public void setRowValues(java.lang.String[] columns,
                         java.lang.Object[] values)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

setRowValues

public void setRowValues(java.lang.Object[][] values)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

getRowValues

public java.lang.Object[] getRowValues(java.lang.String[] columns)
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

getRowValues

public java.lang.Object[][] getRowValues()
                                  throws java.sql.SQLException
Gets an entire row of column values in a two-dimensional array with names as first dimension. The values are returned in an order determined by an internal mapping.

Returns:
the two-dimensional array of values
Throws:
java.lang.IllegalStateException - if the data type is not supported, e.g. STRUCT
java.sql.SQLException

close

public void close()
           throws java.sql.SQLException
Throws:
java.sql.SQLException

setColumnInfo

protected void setColumnInfo(java.lang.Object[] columnInfo)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

getColumnValue

protected java.lang.Object getColumnValue(int columnType,
                                          int columnIndex)
                                   throws java.sql.SQLException
Throws:
java.sql.SQLException

updateColumn

protected void updateColumn(int columnIndex,
                            int columnType,
                            java.lang.Object value)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException



Copyright © 2009 SAS Institute Inc. All Rights Reserved.