|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sibvisions.rad.persist.jdbc.DBAccess
com.sibvisions.rad.persist.jdbc.AbstractOracleDBAccess
public abstract class AbstractOracleDBAccess
The AbstractOracleDBAccess is the base implementation for Oracle databases.
DBAccess| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.sibvisions.rad.persist.jdbc.DBAccess |
|---|
DBAccess.BlobFileHandle, DBAccess.ParameterizedStatement |
| Field Summary | |
|---|---|
protected List<ForeignKey> |
cachedForeignKeys
The cached foreign key. |
protected Hashtable<String,List<String>> |
cachedFoundValues
The cached check constraints. |
protected String |
cachedKeyIdentifier
The cached table identifier. |
protected Key |
cachedPrimaryKey
The cached primary key. |
protected String |
cachedReason
The cached table identifier. |
protected List<Key> |
cachedUniqueKeys
The cached unique key. |
| Fields inherited from class com.sibvisions.rad.persist.jdbc.DBAccess |
|---|
ALLOWED_VALUES_NULL, BFILE, cachedCatalogInfo, cachedColumnMetaData, cachedMetaDataIdentifier, cachedSchemaInfo, COLUMNMETADATA_NULL, currentSavepoint, DEFAULT_VALUES_NULL, FKS_NULL, LONGNVARCHAR, NCHAR, NCLOB, NVARCHAR, PKS_NULL, QUOTE, SQLXML, TABLEINFO_NULL, TABLENAME_NULL, TIMESTAMPWITHLOCALTIMEZONE, TIMESTAMPWITHTIMEZONE, UKS_NULL |
| Constructor Summary | |
|---|---|
AbstractOracleDBAccess()
|
|
| Method Summary | |
|---|---|
protected abstract Object |
convertArrayToList(Object pParam)
Converts arrays to List of IBean. |
protected abstract Object |
convertToArray(AbstractParam pParam)
Converts list or array to oracle arrays. |
protected boolean |
detectModified()
Detects if a transaction is open directly in the database. |
Object |
executeFunction(String pFunctionName,
OutParam pReturnOutParam,
Object... pParameters)
Executes a DB function with the specified parameters and return the result. |
void |
executeProcedure(String pProcedureName,
Object... pParameters)
Executes a DB procedure with the specified parameters. |
protected Map<String,Object[]> |
getAllowedValuesIntern(String pCatalog,
String pSchema,
String pTable)
Gets the allowed values from a specific table. |
protected void |
getAndStoreKeysIntern(String pCatalog,
String pSchema,
String pTable,
String pReason)
Gets all constraints at once, as it is faster in Oracle. |
Connection |
getConnection()
Returns the connection to the database. |
String |
getDatabaseSpecificLockStatement(String pWritebackTable,
ServerMetaData pServerMetaData,
ICondition pPKFilter)
Returns the database specific statement to lock the specified row in the database. |
protected Map<String,Object> |
getDefaultValuesIntern(String pCatalog,
String pSchema,
String pTable)
Gets all default column values of a specific table. |
protected List<ForeignKey> |
getForeignKeysIntern(String pCatalog,
String pSchema,
String pTable)
Returns all Foreign Keys for the specified table. |
protected Key |
getPrimaryKeyIntern(String pCatalog,
String pSchema,
String pTable)
It's gets all Primary Key columns and return it as String[]. |
protected String |
getTableForSynonymIntern(String pStatement,
String pSynomyn)
Gets the table name for a synonym. |
protected TableInfo |
getTableInfoIntern(String pWriteBackTable)
Returns the meta data information for the specified query, and configures all columns with defaults. |
protected List<Key> |
getUniqueKeysIntern(String pCatalog,
String pSchema,
String pTable)
It gets all columns for each Unique Key and return it. |
Object[] |
insertDatabaseSpecific(String pWriteBackTable,
String pInsertStatement,
ServerMetaData pServerMetaData,
Object[] pNewDataRow,
String pDummyColumn)
Returns the newly inserted row from a Database specific insert statement. |
protected Object[] |
insertOracle(String pTablename,
String pInsertStatement,
ServerMetaData pServerMetaData,
Object[] pNewDataRow,
String pDummyColumn)
Returns the newly inserted row from an Oracle Database. |
void |
open()
It opens the database and stores the Connection object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected String cachedKeyIdentifier
protected String cachedReason
protected Key cachedPrimaryKey
protected List<Key> cachedUniqueKeys
protected List<ForeignKey> cachedForeignKeys
protected Hashtable<String,List<String>> cachedFoundValues
| Constructor Detail |
|---|
public AbstractOracleDBAccess()
| Method Detail |
|---|
protected abstract Object convertArrayToList(Object pParam)
throws SQLException
List of IBean.
pParam - the param to check
SQLException - the exception
protected abstract Object convertToArray(AbstractParam pParam)
throws SQLException
pParam - the param to check
SQLException - the exception
public String getDatabaseSpecificLockStatement(String pWritebackTable,
ServerMetaData pServerMetaData,
ICondition pPKFilter)
throws DataSourceException
getDatabaseSpecificLockStatement in class DBAccesspWritebackTable - the table to use.pServerMetaData - the MetaDataColumn array to use.pPKFilter - the PK filter with the values to use.
DataSourceException - if some parts are missing for the statement
public Object[] insertDatabaseSpecific(String pWriteBackTable,
String pInsertStatement,
ServerMetaData pServerMetaData,
Object[] pNewDataRow,
String pDummyColumn)
throws DataSourceException
insertDatabaseSpecific in class DBAccesspWriteBackTable - the table to use for the insertpInsertStatement - the SQL Statement to use for the insertpServerMetaData - the meta data to use.pNewDataRow - the new row (Object[]) with the values to insertpDummyColumn - null, if all writeable columns are null, but for a correct INSERT it have
to be minimum one column to use in the syntax.
DataSourceException - if an Exception occur during insert to the storage
public void open()
throws DataSourceException
Connection object.
open in class DBAccessDataSourceException - if the database couldn't opened
public Connection getConnection()
throws SQLException
connection to the database.
getConnection in class DBAccessconnection to the database.
SQLException - if connection is not available.
protected void getAndStoreKeysIntern(String pCatalog,
String pSchema,
String pTable,
String pReason)
throws DataSourceException
pCatalog - the catalogpSchema - the schemapTable - the tablepReason - the reason
DataSourceException - the exception
protected List<Key> getUniqueKeysIntern(String pCatalog,
String pSchema,
String pTable)
throws DataSourceException
getUniqueKeysIntern in class DBAccesspCatalog - the catalog to usepSchema - the schema to usepTable - the table to use
DataSourceException - if an error occur during UK search process.
protected Key getPrimaryKeyIntern(String pCatalog,
String pSchema,
String pTable)
throws DataSourceException
getPrimaryKeyIntern in class DBAccesspCatalog - the catalog to usepSchema - the schema to usepTable - the table to use
DataSourceException - if an error occur during PK search process.
protected List<ForeignKey> getForeignKeysIntern(String pCatalog,
String pSchema,
String pTable)
throws DataSourceException
getForeignKeysIntern in class DBAccesspCatalog - the catalog to usepSchema - the schema to usepTable - the table to use as base table.
DataSourceException - if an error occur in determining the ForeignKeys.
protected Map<String,Object> getDefaultValuesIntern(String pCatalog,
String pSchema,
String pTable)
throws DataSourceException
getDefaultValuesIntern in class DBAccesspCatalog - the catalog namepSchema - the schema namepTable - the table name
Hashtable with the column name as key and the default value as value. It only contains columns
with a default value
DataSourceException - if the database access throws an exception
protected Map<String,Object[]> getAllowedValuesIntern(String pCatalog,
String pSchema,
String pTable)
throws DataSourceException
getAllowedValuesIntern in class DBAccesspCatalog - the catalog namepSchema - the schema namepTable - the table to check
Hashtable with a column name as key and the allowed values as array of Objects or
null if there are no allowed values
DataSourceException - if the database access throws an exception
protected TableInfo getTableInfoIntern(String pWriteBackTable)
throws DataSourceException
getTableInfoIntern in class DBAccesspWriteBackTable - the write back table to use for the isWriteable() state (Optional)
DataSourceException - if an Exception occur during getting the meta data or
if the storage is not opened or
if one columns SQL type is not supportedprotected boolean detectModified()
detectModified in class DBAccess
public Object executeFunction(String pFunctionName,
OutParam pReturnOutParam,
Object... pParameters)
throws SQLException
executeFunction in class DBAccesspFunctionName - the function (optional with package) name.pReturnOutParam - the return SQL Type (see TypespParameters - the parameters to use with the correct and corresponding java type.
SQLException - if the call failed.
public void executeProcedure(String pProcedureName,
Object... pParameters)
throws SQLException
executeProcedure in class DBAccesspProcedureName - the procedure (optional with package) name.pParameters - the parameters to use with the correct and corresponding java type.
SQLException - if the call failed.
protected Object[] insertOracle(String pTablename,
String pInsertStatement,
ServerMetaData pServerMetaData,
Object[] pNewDataRow,
String pDummyColumn)
throws DataSourceException
pTablename - the table to use for the insertpInsertStatement - the SQL Statement to use for the insertpServerMetaData - the meta data to use.pNewDataRow - the new IDataRow with the values to insertpDummyColumn - true, if all writeable columns are null, but for a correct INSERT it have
to be minimum one column to use in the syntax.
DataSourceException - if an Exception occur during insert the IDataRow
to the storage
protected String getTableForSynonymIntern(String pStatement,
String pSynomyn)
throws DataSourceException
pStatement - the synonym metadata statementpSynomyn - the name of the synonym
pSynonym name if no synonym was found
DataSourceException - if synonym detection failed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||