|
Oracle Fusion Middleware Java API Reference for Oracle Real-Time Decisions 11g Release 1 (11.1.1) E17787-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.sigmadynamics.server.DataServices.DatabaseProvider.DatabaseProvider
public class DatabaseProvider
This class provides platform support for reading, updating, deleting, and inserting records across many different types of databases.
Field Summary | |
---|---|
static DatabaseSettings |
SETTINGS |
Fields inherited from interface com.sigmadynamics.server.DataServices.DatabaseProvider.DatabaseProviderInterface |
---|
DBTYPE_DB2, DBTYPE_MSSQLSERVER, DBTYPE_MYSQL, DBTYPE_ORACLE, DBTYPE_SIEBEL_ANALYTICS, DBTYPE_UNKNOWN |
Constructor Summary | |
---|---|
|
DatabaseProvider(SDDataSource dataSource) Deprecated. since 3.0. Please use DatabaseProvider.DatabaseProvider(SDDataSourceInterface) instead. |
|
DatabaseProvider(SDDataSourceInterface dataSource) Initializes a newly created DatabaseProvider with a data source specified by data source . |
protected |
DatabaseProvider(SDDataSourceInterface dataSource, boolean start) |
|
DatabaseProvider(java.lang.String dataSourceName) |
Method Summary | |
---|---|
static void |
closeConnection(java.sql.Connection conn) Deprecated. as of 11.1.1.1.2.0, Use Util.closeConnection(Connection) instead |
static void |
closeResultSet(java.sql.ResultSet rs) Deprecated. as of 11.1.1.1.2.0, Use Util.closeResultSet(ResultSet) instead |
static void |
closeStatement(java.sql.Statement stmt) Deprecated. as of 11.1.1.1.2.0, Use Util.closeStatement(Statement) instead |
java.sql.Connection |
getConnection() |
int |
getDatabaseType() |
SDDataSourceInterface |
getDataSource() |
DeadlockHandler |
getDeadlockHandler() Returns a new deadlock handler object. |
ManualFlushTableInserter |
getManualFlushTableInserter(java.lang.String table, java.lang.String[] columns, int bufferSize, boolean autoGrowBuffer) Returns a manually-flushed batched TableInserter that can be used for inserting data into a database table. |
DatabaseProviderMetaData |
getMetaData() |
StoredProcedure |
getStoredProcedure(java.lang.String storedProcedureName, int paramCount) Returns a StoredProcedure object that is used to call stored procedures in a database. |
StoredProcCacheEntry |
getStoredProcInfo(java.lang.String procName, boolean refresh) |
TableCacheEntry |
getTableCacheEntry(java.lang.String tableName, boolean refresh) get the cache entry for the specified table |
TableDeleter |
getTableDeleter(java.lang.String table) Returns a TableDeleter that can be used for deleting rows in a database table. |
TableDeleter |
getTableDeleter(java.lang.String table, int batchSize, int maxQueueLength) Returns a TableDeleter that can be used for deleting rows in a database table. |
TableDeleter |
getTableDeleter(java.lang.String table, java.lang.String[] whereColumns) Returns a TableDeleter that can be used for deleting rows from a database table, one at a time. |
TableDeleter |
getTableDeleter(java.lang.String table, java.lang.String[] whereColumns, int whereType, int batchSize, int maxQueueLength) Returns a TableDeleter that can be used for deleting rows in a database table. |
TableDeleter |
getTableDeleter(java.lang.String table, java.lang.String[] whereColumns, java.lang.String where, int batchSize, int maxQueueLength) Returns a TableDeleter that can be used for deleting rows in a database table. |
TableCacheEntry |
getTableInfo(java.lang.String tableName) |
TableInserter |
getTableInserter(java.lang.String table, java.lang.String... columns) Returns an un-batched TableInserter that can be used for inserting data into database tables, one row at a time. |
TableInserter |
getTableInserter(java.lang.String table, java.lang.String[] columns, int batchSize, int maxQueueLength) Returns an auto-flush batched TableInserter that can be used for inserting data into a database table. |
TableReader |
getTableReader(java.lang.String table, java.lang.String[] columns) Returns a TableReader that can be used for reading a database table. |
TableReader |
getTableReader(java.lang.String table, java.lang.String[] columns, java.lang.String[] whereColumns) Returns a TableReader that can be used for reading a database table. |
TableReader |
getTableReader(java.lang.String table, java.lang.String[] columns, java.lang.String[] whereColumns, int whereType) Returns a TableReader that can be used for reading a database table. |
TableReader |
getTableReader(java.lang.String table, java.lang.String[] columns, java.lang.String[] whereColumns, java.lang.String where) Returns a TableReader that can be used for reading a database table. |
TableUpdater |
getTableUpdater(java.lang.String table, java.lang.String[] columns) Returns a TableUpdater that can be used for updating data in a database table. |
TableUpdater |
getTableUpdater(java.lang.String table, java.lang.String[] columns, int batchSize, int maxQueueLength) Returns a TableUpdater that can be used for updating data in a database table. |
TableUpdater |
getTableUpdater(java.lang.String table, java.lang.String[] columns, java.lang.String[] whereColumns, int whereType, int batchSize, int maxQueueLength) Returns a TableUpdater that can be used for updating data in a database table. |
TableUpdater |
getTableUpdater(java.lang.String table, java.lang.String[] columns, java.lang.String[] whereColumns, java.lang.String where, int batchSize, int maxQueueLength) Returns a TableUpdater that can be used for updating data in a database table. |
WriteOnlyStoredProcedure |
getWriteOnlyStoredProcedure(java.lang.String storedProcedureName, int paramCount, int batchSize, int maxQueueLength) Returns a WriteOnlyStoredProcedure that can be used to call a stored procedure that updates data in a database but does not return any data. |
boolean |
isCaseSensitive() Indicates whether the datasource associated with the DataProvider is case sensitive. |
void |
removeProcedureCacheEntry(java.lang.String procName) |
boolean |
supportsBatchUpdates() |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final DatabaseSettings SETTINGS
Constructor Detail |
---|
@Deprecated
public DatabaseProvider(SDDataSource dataSource)
DatabaseProvider.DatabaseProvider(SDDataSourceInterface)
instead.
public DatabaseProvider(SDDataSourceInterface dataSource)
Initializes a newly created DatabaseProvider with a data source specified by data source
.
A DatabaseProvider is used to obtain the other objects that are part of the DatabaseProvider API, e.g. TableReader or TableInserter. The DatabaseProvider class keeps a system-wide cache of metadata so that it doesn't need to go to the database every time.
There is no need to close or release a DatabaseProvider instance.
dataSource
- an object that the J2EE app server uses to get connections.protected DatabaseProvider(SDDataSourceInterface dataSource, boolean start)
public DatabaseProvider(java.lang.String dataSourceName)
Method Detail |
---|
public boolean supportsBatchUpdates()
supportsBatchUpdates
in interface DatabaseProviderInterface
public java.sql.Connection getConnection()
getConnection
in interface DatabaseProviderInterface
public static final void closeConnection(java.sql.Connection conn)
Util.closeConnection(Connection)
insteadpublic static final void closeStatement(java.sql.Statement stmt)
Util.closeStatement(Statement)
insteadpublic static final void closeResultSet(java.sql.ResultSet rs)
Util.closeResultSet(ResultSet)
insteadpublic TableReader getTableReader(java.lang.String table, java.lang.String[] columns)
DatabaseProviderInterface
TableReader
that can be used for reading a database table.
The columns specified by columns
are returned. All rows of the table are returned.
getTableReader
in interface DatabaseProviderInterface
table
- the table to readcolumns
- the names of the columns to select (the projection). If null
, then all columns are selected.public TableReader getTableReader(java.lang.String table, java.lang.String[] columns, java.lang.String[] whereColumns, int whereType)
DatabaseProviderInterface
TableReader
that can be used for reading a database table.
The columns specified by columns
are returned. The selection of the rows is governed by the 'where' parameters.
getTableReader
in interface DatabaseProviderInterface
table
- the name of the table to readcolumns
- the names of the columns to select. A null
specifies all columns.whereColumns
- the names of the columns used to select rows (see the Where
interface)whereType
- used to specify whether Where terms are intersection or union (see the Where
interface)Where
public TableReader getTableReader(java.lang.String table, java.lang.String[] columns, java.lang.String[] whereColumns)
DatabaseProviderInterface
TableReader
that can be used for reading a database table.
The columns specified by columns
are returned. The selection of the rows is governed by the 'where' parameters.
getTableReader
in interface DatabaseProviderInterface
table
- the name of the table to readcolumns
- the names of the columns to select. A null
specifies all columns.whereColumns
- the names of the columns used to select rows. The conditions are combined using AND
operators.Where
public TableReader getTableReader(java.lang.String table, java.lang.String[] columns, java.lang.String[] whereColumns, java.lang.String where)
DatabaseProviderInterface
TableReader
that can be used for reading a database table.
The columns specified by columns
are returned. The selection of the rows is governed by the 'where' parameters.
getTableReader
in interface DatabaseProviderInterface
table
- the name of the table to readcolumns
- the names of the columns to select. A null
specifies all columns.whereColumns
- the names of the columns used to select rows (see the Where
interface)where
- a string used in constructing a WHERE clause (see the Where
interface)public TableInserter getTableInserter(java.lang.String table, java.lang.String... columns)
DatabaseProviderInterface
TableInserter
that can be used for inserting data into database tables, one row at a time.
The columns into which data will be inserted are specified by columns
. Batch operation is enabled if the batchSize
parameter is greater than one and the database supports batch operations.
getTableInserter
in interface DatabaseProviderInterface
table
- the name of the table to insert data intocolumns
- the names of the columns to insert data intopublic TableInserter getTableInserter(java.lang.String table, java.lang.String[] columns, int batchSize, int maxQueueLength)
DatabaseProviderInterface
TableInserter
that can be used for inserting data into a database table.
The columns into which data will be inserted are specified by columns
. Batch operation is enabled if the batchSize
parameter is greater than one and the database supports batch operations.
getTableInserter
in interface DatabaseProviderInterface
table
- the name of the table to insert data intocolumns
- the names of the columns to insert data intobatchSize
- the number of insert operations to batch together before submitting them to the databasepublic ManualFlushTableInserter getManualFlushTableInserter(java.lang.String table, java.lang.String[] columns, int bufferSize, boolean autoGrowBuffer)
DatabaseProviderInterface
TableInserter
that can be used for inserting data into a database table.
The columns into which data will be inserted are specified by columns
. Batch operation is enabled if the bufferSize
parameter is greater than one and the database supports batch operations.
getManualFlushTableInserter
in interface DatabaseProviderInterface
table
- the name of the table to insert data intocolumns
- the names of the columns to insert data intobufferSize
- the initial buffer will be large enough to hold this number of insert operations.autoGrowBuffer
- true if the buffer should automatically grow when an attempt is made to insert too many rows. If false, an SDRunTimeException will be thrown.public TableUpdater getTableUpdater(java.lang.String table, java.lang.String[] columns)
DatabaseProviderInterface
TableUpdater
that can be used for updating data in a database table.
The columns that are to be updated are specified by columns
. Batch operation is enabled if the batchSize
parameter is greater than one and the database supports batch operations.
getTableUpdater
in interface DatabaseProviderInterface
table
- the name of the table which is to be updatedcolumns
- the names of the columns which are to be updatedpublic TableUpdater getTableUpdater(java.lang.String table, java.lang.String[] columns, int batchSize, int maxQueueLength)
DatabaseProviderInterface
TableUpdater
that can be used for updating data in a database table.
The columns that are to be updated are specified by columns
. Batch operation is enabled if the batchSize
parameter is greater than one and the database supports batch operations.
getTableUpdater
in interface DatabaseProviderInterface
table
- the name of the table which is to be updatedcolumns
- the names of the columns which are to be updatedbatchSize
- the number of update operations to batch together before submitting them to the databasepublic TableUpdater getTableUpdater(java.lang.String table, java.lang.String[] columns, java.lang.String[] whereColumns, int whereType, int batchSize, int maxQueueLength)
DatabaseProviderInterface
TableUpdater
that can be used for updating data in a database table.
The columns that are to be updated are specified by columns
. Batch operation is enabled if the batchSize
parameter is greater than one and the database supports batch operations. The selection of the rows is governed by the 'where' parameters.
getTableUpdater
in interface DatabaseProviderInterface
table
- the name of the table which is to be updatedcolumns
- the names of the columns which are to be updatedwhereColumns
- the names of the columns used to select rows (see the Where
interface)whereType
- used to specify whether Where terms are intersection or union (see the Where
interface)batchSize
- the number of update operations to batch together before submitting to the databasepublic TableUpdater getTableUpdater(java.lang.String table, java.lang.String[] columns, java.lang.String[] whereColumns, java.lang.String where, int batchSize, int maxQueueLength)
DatabaseProviderInterface
TableUpdater
that can be used for updating data in a database table.
The columns that are to be updated are specified by columns
. Batch operation is enabled if the batchSize
parameter is greater than one and the database supports batch operations. The selection of the rows is governed by the 'where' parameters.
getTableUpdater
in interface DatabaseProviderInterface
table
- the name of the table which is to be updatedcolumns
- the names of the columns which are to be updatedwhereColumns
- the names of the columns used to select rows (see the Where
interface)where
- a string used in constructing a WHERE clause (see the Where
interface)batchSize
- the number of update operations to batch together before submitting to the databasepublic TableDeleter getTableDeleter(java.lang.String table)
DatabaseProviderInterface
TableDeleter
that can be used for deleting rows in a database table.
Batch operation is enabled if the batchSize
parameter is greater than one and the database supports batch operations.
getTableDeleter
in interface DatabaseProviderInterface
table
- the name of the table from which rows will be deletedpublic TableDeleter getTableDeleter(java.lang.String table, int batchSize, int maxQueueLength)
DatabaseProviderInterface
TableDeleter
that can be used for deleting rows in a database table.
Batch operation is enabled if the batchSize
parameter is greater than one and the database supports batch operations.
getTableDeleter
in interface DatabaseProviderInterface
table
- the name of the table from which rows will be deletedbatchSize
- the number of delete operations to batch together before submitting them to the databasepublic TableDeleter getTableDeleter(java.lang.String table, java.lang.String[] whereColumns, int whereType, int batchSize, int maxQueueLength)
DatabaseProviderInterface
TableDeleter
that can be used for deleting rows in a database table.
Batch operation is enabled if the batchSize
parameter is greater than one and the database supports batch operations.
getTableDeleter
in interface DatabaseProviderInterface
table
- the name of the table from which rows will be deletedwhereColumns
- the names of the columns used to select rows (see the Where
interface)whereType
- used to specify whether Where terms are intersection or union (see the Where
interface)batchSize
- the number of delete operations to batch together before submitting them to the databasepublic TableDeleter getTableDeleter(java.lang.String table, java.lang.String[] whereColumns)
DatabaseProviderInterface
TableDeleter
that can be used for deleting rows from a database table, one at a time.
Batch operation is disabled.
getTableDeleter
in interface DatabaseProviderInterface
table
- the name of the table from which rows will be deletedwhereColumns
- the names of the columns used to select rows. The conditions are combined using AND
operators.Where
public TableDeleter getTableDeleter(java.lang.String table, java.lang.String[] whereColumns, java.lang.String where, int batchSize, int maxQueueLength)
DatabaseProviderInterface
TableDeleter
that can be used for deleting rows in a database table.
Batch operation is enabled if the batchSize
parameter is greater than one and the database supports batch operations.
The selection of the rows is governed by the 'where' parameters.
getTableDeleter
in interface DatabaseProviderInterface
table
- the name of the table from which rows will be deletedwhereColumns
- the names of the columns used to select rows (see the Where
interface)where
- a string used in constructing a WHERE clause (see the Where
interface)batchSize
- the number of delete operations to batch together before submitting them to the databaseTableDeleter
public StoredProcedure getStoredProcedure(java.lang.String storedProcedureName, int paramCount)
DatabaseProviderInterface
StoredProcedure
object that is used to call stored procedures in a database.
Don't forget to call WriteOnlyStoredProcedure.close()
getStoredProcedure
in interface DatabaseProviderInterface
storedProcedureName
- the name of the stored procedureparamCount
- a parameter that is either the number of parameters to use or StoredProcedure.ALL_PARAMETERS. The latter means that it will automatically discover the number of parameters.the StoredProcedure
objectpublic WriteOnlyStoredProcedure getWriteOnlyStoredProcedure(java.lang.String storedProcedureName, int paramCount, int batchSize, int maxQueueLength)
DatabaseProviderInterface
WriteOnlyStoredProcedure
that can be used to call a stored procedure that updates data in a database but does not return any data.
Batch operation is enabled if the batchSize
parameter is greater than one and the database supports batch operations.
getWriteOnlyStoredProcedure
in interface DatabaseProviderInterface
storedProcedureName
- the name of the stored procedureparamCount
- a parameter that is either the number of parameters to use or StoredProcedure.ALL_PARAMETERS. The latter means that it will automatically discover the number of parameters.batchSize
- the number of stored procedure calls to batch together before submitting them to the databasethe StoredProcedure
objectpublic DatabaseProviderMetaData getMetaData()
getMetaData
in interface DatabaseProviderInterface
public boolean isCaseSensitive()
DatabaseProviderInterface
isCaseSensitive
in interface DatabaseProviderInterface
public int getDatabaseType()
getDatabaseType
in interface DatabaseProviderInterface
public TableCacheEntry getTableCacheEntry(java.lang.String tableName, boolean refresh)
DatabaseProviderInterface
This method was necessitated by the need to get columns info to support Oracle I18n data.
getTableCacheEntry
in interface DatabaseProviderInterface
public SDDataSourceInterface getDataSource()
getDataSource
in interface DatabaseProviderInterface
public StoredProcCacheEntry getStoredProcInfo(java.lang.String procName, boolean refresh)
getStoredProcInfo
in interface DatabaseProviderInterface
public TableCacheEntry getTableInfo(java.lang.String tableName)
getTableInfo
in interface DatabaseProviderInterface
public void removeProcedureCacheEntry(java.lang.String procName)
removeProcedureCacheEntry
in interface DatabaseProviderInterface
public DeadlockHandler getDeadlockHandler()
Although a new object is created on each call, this method is only called when exceptions occur. If we determine that this is still too expensive, then we can implement a pool.
A single deadlock handler object is no longer sufficient (as it once was) because various database operations that can produce deadlock may be occurring concurrently and it is common to have state in a deadlock handler, e.g. a count of the number of tries.
getDeadlockHandler
in interface DatabaseProviderInterface
|
Oracle Fusion Middleware Java API Reference for Oracle Real-Time Decisions 11g Release 1 (11.1.1) E17787-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |