DatabaseAccessor also defines a single reference through which all configuration dependent behavior may be invoked.
DabaseAccessor implements the following behavior.
DatabasePlatform
| Modifier and Type | Field and Description |
|---|---|
| protected BatchWritingMechanism | activeBatchWritingMechanism
This attribute will be used to store the currently active Batch Mechanism |
| protected DynamicSQLBatchWritingMechanism | dynamicSQLMechanism
These two attributes store the available BatchWritingMechanisms. |
| protected Statement | dynamicStatement
PERF: Cache the statement object for dynamic SQL execution. |
| protected boolean | |
| protected LOBValueWriter | |
| protected DatabaseMetaData | metaData
Cache of the connection's java.sql.DatabaseMetaData |
| protected ParameterizedSQLBatchWritingMechanism | |
| public static boolean | shouldUseDynamicStatements
PERF: Backdoor to disabling dynamic statements. |
| protected Map | statementCache
Stores statement handles for common used prepared statements. |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized Statement | |
| public void | basicBeginTransaction(AbstractSession session)
Implements abstract org. |
| public void | basicCommitTransaction(AbstractSession session)
Implements abstract org. |
| public Object | Returns: depending of the type either the row count, row or vector of rows.Implements abstract org. |
| public Object | Returns: depending of the type either the row count, row or vector of rows.Execute the call. |
| public void | basicRollbackTransaction(AbstractSession session)
Implements abstract org. |
| protected void | buildConnectLog(AbstractSession session)
Implements abstract org. |
| public AbstractRecord | buildOutputRow(CallableStatement statement, DatabaseCall call, AbstractSession session)
Build a row from the output parameters of a sp call. |
| public Vector | buildSortedFields(Vector<DatabaseField> fields, ResultSet resultSet, AbstractSession session)
Return the field sorted in the correct order corresponding to the result set. |
| protected Vector | buildThreadCursoredResult(final DatabaseCall dbCall, final ResultSet resultSet, final Statement statement, final ResultSetMetaData metaData, final AbstractSession session)
This allows for the rows to be fetched concurrently to the objects being built. |
| protected void | checkTransactionIsolation(AbstractSession session)
Check to see if the transaction isolation needs to be set for the newly created connection. |
| public void | |
| public Object | clone()
Overrides org. Implements org. |
| public void | closeConnection()
Overrides org. Implements org. |
| public void | closeCursor(ResultSet resultSet, AbstractSession session)
Close the result set of the cursored stream. |
| public void | closeDatasourceConnection()
Implements abstract org. |
| public void | closeStatement(Statement statement, AbstractSession session, DatabaseCall call)
INTERNAL: Closes a PreparedStatement (which is supposed to close it's current resultSet). |
| public void | commitTransaction(AbstractSession session)
Overrides org. Implements org. |
| protected void | connectInternal(Login login, AbstractSession session)
Overrides org. |
| public AbstractRecord | cursorRetrieveNextRow(Vector<DatabaseField> fields, ResultSet resultSet, AbstractSession session)
Advance the result set and return a Record populated with values from the next valid row in the result set. |
| public AbstractRecord | cursorRetrievePreviousRow(Vector<DatabaseField> fields, ResultSet resultSet, AbstractSession session)
Advance the result set and return a DatabaseRow populated with values from the next valid row in the result set. |
| public void | disconnect(AbstractSession session)
Overrides org. Implements org. |
| public boolean | |
| protected void | executeBatchedStatement(PreparedStatement statement, AbstractSession session)
Execute the EclipseLink dynamically batched/concatenated statement. |
| public Object | Returns: depending of the type either the row count, row or vector of rows.Overrides org. Implements org. |
| public Object | executeDirectNoSelect(Statement statement, DatabaseCall call, AbstractSession session)
Execute the statement. |
| protected int | executeJDK12BatchStatement(Statement statement, DatabaseCall dbCall, AbstractSession session, boolean isStatementPrepared)
Execute the batched statement through the JDBC2 API. |
| protected Object | executeNoSelect(DatabaseCall call, Statement statement, AbstractSession session)
Execute the statement. |
| public ResultSet | executeSelect(DatabaseCall call, Statement statement, AbstractSession session)
Execute the statement. |
| protected AbstractRecord | fetchRow(Vector<DatabaseField> fields, ResultSet resultSet, ResultSetMetaData metaData, AbstractSession session)
Return a new DatabaseRow. |
| public AbstractRecord | fetchRow(Vector<DatabaseField> fields, DatabaseField[] fieldsArray, ResultSet resultSet, ResultSetMetaData metaData, AbstractSession session)
Return a new DatabaseRow. |
| public void | flushSelectCalls(AbstractSession session)
Overrides org. Implements org. |
| public BatchWritingMechanism | getActiveBatchWritingMechanism(AbstractSession session)
INTERNAL: This method is used internally to return the active batch writing mechanism to batch the statement |
| public String | |
| public Vector | Returns: a Vector of DatabaseRows.a catalog name; "" retrieves those without a
catalog; null means drop catalog name from the selection criteria catalog, String schema name pattern; "" retrieves those
without a schema schema, String a table name pattern tableName, String a column name pattern columnName, AbstractSession session)Overrides org. Implements org. |
| public Vector | getColumnInfo(String tableName, String columnName, AbstractSession session)
Overrides org. Implements org. Accessor.
|
| protected Vector | getColumnNames(ResultSet resultSet, AbstractSession session)
Return the column names from a result sets meta data as a vector of DatabaseFields. |
| public Connection | getConnection()
Overrides org. Implements org. |
| public DatabaseMetaData | |
| protected DynamicSQLBatchWritingMechanism | |
| public LOBValueWriter | |
| public Object | getObject(ResultSet resultSet, DatabaseField field, ResultSetMetaData metaData, int columnNumber, DatabasePlatform platform, boolean optimizeData, AbstractSession session)
Return an object retrieved from resultSet with the getObject() method. |
| protected Object | Returns: new instance of converted type orthis if no optimized conversion wasdoneJDBC resultSet, DatabaseField ResultSet with query resultdatabase field mapping field, int database type from type, int java. or provider specific typenumber of column to fetch columnNumber, DatabasePlatform current database platform platform, AbstractSession current database session session)Handle the |
| protected ParameterizedSQLBatchWritingMechanism | |
| public DatabasePlatform | |
| public String | |
| protected synchronized Map | |
| public Vector | Returns: a Vector of DatabaseRows.a catalog name; "" retrieves those without a
catalog; null means drop catalog name from the selection criteria catalog, String a schema name pattern; "" retrieves those
without a schema schema, String a table name pattern tableName, String[] a list of table types to include; null returns all types types, AbstractSession session)Overrides org. Implements org. |
| public Vector | getTableInfo(String tableName, String[] types, AbstractSession session)
Overrides org. Implements org. Accessor.
|
| protected boolean | |
| private boolean | |
| public static boolean | |
| public static boolean | |
| public boolean | isDatasourceConnected()
Implements abstract org. |
| public boolean | |
| protected boolean | |
| private boolean | |
| public void | populateRow(DatabaseField[] fieldsArray, Object[] values, ResultSet resultSet, ResultSetMetaData metaData, AbstractSession session, int startIndex, int endIndex)
|
| public Statement | |
| public Statement | prepareStatement(DatabaseCall call, AbstractSession session, boolean
boolean flag set to true to unwrap the connection before preparing the statement in the
case of a parameterized call. unwrapConnection)Prepare the SQL statement for the call. |
| public PreparedStatement | prepareStatement(String sql, AbstractSession session, boolean callable)
Prepare the SQL statement for the call. |
| public DatabaseException | processExceptionForCommError(AbstractSession session, SQLException exception, Call call)
This method is used to process an SQL exception and determine if the exception should be passed on for further processing. |
| public Object | processResultSet(ResultSet resultSet, DatabaseCall call, Statement statement, AbstractSession session)
Fetch all the rows from the result set. |
| protected void | reconnect(AbstractSession session)
Overrides org. |
| public void | releaseStatement(Statement statement, String sqlString, DatabaseCall call, AbstractSession session)
Release the statement through closing it or putting it back in the statement cache. |
| protected void | resetStatementFromCall(Statement statement, DatabaseCall call)
Reset the Query Timeout, Max Rows, Resultset fetch size on the Statement if the DatabaseCall has values which differ from the default settings. |
| public void | rollbackTransaction(AbstractSession session)
Overrides org. Implements org. |
| public void | setActiveBatchWritingMechanism(BatchWritingMechanism mechanism)
INTERNAL: This method is used to set the active Batch Mechanism on the accessor. |
| public void | setActiveBatchWritingMechanismToDynamicSQL()
INTERNAL: This method is used to set the active Batch Mechanism on the accessor. |
| public void | setActiveBatchWritingMechanismToParameterizedSQL()
INTERNAL: This method is used to set the active Batch Mechanism on the accessor. |
| public void | setDatasourcePlatform(DatasourcePlatform platform)
Overrides org. |
| public synchronized void | setIsDynamicStatementInUse(boolean isDynamicStatementInUse)
Set if the cached statement for dynamic SQL execution is in use. |
| protected void | setStatementCache(Hashtable<String, Statement> statementCache)
The statement cache stores a fixed sized number of prepared statements. |
| protected Vector | sortFields(Vector<DatabaseField> fields, Vector<DatabaseField> columnNames)
This method will sort the fields in correct order based on the column names. |
| public String | |
| public void | writesCompleted(AbstractSession session)
Overrides org. Implements org. |