|
||||||||||
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 |
---|
Fields inherited from class com.sibvisions.rad.persist.jdbc.DBAccess |
---|
BFILE, LONGNVARCHAR, NCHAR, NCLOB, NVARCHAR, QUOTE, SQLXML, TIMESTAMPWITHLOCALTIMEZONE, TIMESTAMPWITHTIMEZONE |
Constructor Summary | |
---|---|
AbstractOracleDBAccess()
|
Method Summary | |
---|---|
protected abstract java.lang.Object |
convertArrayToList(java.lang.Object pParam)
Converts arrays to List of IBean . |
protected abstract java.lang.Object |
convertToArray(AbstractParam pParam)
Converts list or array to oracle arrays. |
protected boolean |
detectModified()
Detects if a transaction is open directly in the database. |
java.lang.Object |
executeFunction(java.lang.String pFunctionName,
OutParam pReturnOutParam,
java.lang.Object... pParameters)
Executes a DB function with the specified parameters and return the result. |
void |
executeProcedure(java.lang.String pProcedureName,
java.lang.Object... pParameters)
Executes a DB procedure with the specified parameters. |
protected java.util.Map<java.lang.String,java.lang.Object[]> |
getAllowedValuesIntern(java.lang.String pCatalog,
java.lang.String pSchema,
java.lang.String pTable)
Gets the allowed values from a specific table. |
java.lang.String |
getDatabaseSpecificLockStatement(java.lang.String pWritebackTable,
ServerMetaData pServerMetaData,
ICondition pPKFilter)
Returns the database specific statement to lock the specified row in the database. |
protected java.util.Map<java.lang.String,java.lang.Object> |
getDefaultValuesIntern(java.lang.String pCatalog,
java.lang.String pSchema,
java.lang.String pTable)
Gets all default column values of a specific table. |
protected java.util.List<ForeignKey> |
getForeignKeysIntern(java.lang.String pCatalog,
java.lang.String pSchema,
java.lang.String pTable)
Returns all Foreign Keys for the specified table. |
protected Key |
getPrimaryKeyIntern(java.lang.String pCatalog,
java.lang.String pSchema,
java.lang.String pTable)
It's gets all Primary Key columns and return it as String[]. |
protected java.lang.String |
getTableForSynonymIntern(java.lang.String pStatement,
java.lang.String pSynomyn)
Gets the table name for a synonym. |
protected TableInfo |
getTableInfoIntern(java.lang.String pWriteBackTable)
Returns the meta data information for the specified query, and configures all columns with defaults. |
protected java.util.List<Key> |
getUniqueKeysIntern(java.lang.String pCatalog,
java.lang.String pSchema,
java.lang.String pTable)
It gets all columns for each Unique Key and return it. |
java.lang.Object[] |
insertDatabaseSpecific(java.lang.String pWriteBackTable,
java.lang.String pInsertStatement,
ServerMetaData pServerMetaData,
java.lang.Object[] pNewDataRow,
java.lang.String pDummyColumn)
Returns the newly inserted row from a Database specific insert statement. |
protected java.lang.Object[] |
insertOracle(java.lang.String pTablename,
java.lang.String pInsertStatement,
ServerMetaData pServerMetaData,
java.lang.Object[] pNewDataRow,
java.lang.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 |
Constructor Detail |
---|
public AbstractOracleDBAccess()
Method Detail |
---|
protected abstract java.lang.Object convertArrayToList(java.lang.Object pParam) throws java.sql.SQLException
List
of IBean
.
pParam
- the param to check
java.sql.SQLException
- the exceptionprotected abstract java.lang.Object convertToArray(AbstractParam pParam) throws java.sql.SQLException
pParam
- the param to check
java.sql.SQLException
- the exceptionpublic java.lang.String getDatabaseSpecificLockStatement(java.lang.String pWritebackTable, ServerMetaData pServerMetaData, ICondition pPKFilter) throws DataSourceException
getDatabaseSpecificLockStatement
in class DBAccess
pWritebackTable
- 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 statementpublic java.lang.Object[] insertDatabaseSpecific(java.lang.String pWriteBackTable, java.lang.String pInsertStatement, ServerMetaData pServerMetaData, java.lang.Object[] pNewDataRow, java.lang.String pDummyColumn) throws DataSourceException
insertDatabaseSpecific
in class DBAccess
pWriteBackTable
- 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 storagepublic void open() throws DataSourceException
Connection
object.
open
in class DBAccess
DataSourceException
- if the database couldn't openedprotected java.util.List<Key> getUniqueKeysIntern(java.lang.String pCatalog, java.lang.String pSchema, java.lang.String pTable) throws DataSourceException
getUniqueKeysIntern
in class DBAccess
pCatalog
- the catalog to usepSchema
- the schema to usepTable
- the table to use
DataSourceException
- if an error occur during UK search process.protected Key getPrimaryKeyIntern(java.lang.String pCatalog, java.lang.String pSchema, java.lang.String pTable) throws DataSourceException
getPrimaryKeyIntern
in class DBAccess
pCatalog
- the catalog to usepSchema
- the schema to usepTable
- the table to use
DataSourceException
- if an error occur during PK search process.protected java.util.List<ForeignKey> getForeignKeysIntern(java.lang.String pCatalog, java.lang.String pSchema, java.lang.String pTable) throws DataSourceException
getForeignKeysIntern
in class DBAccess
pCatalog
- 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 java.util.Map<java.lang.String,java.lang.Object> getDefaultValuesIntern(java.lang.String pCatalog, java.lang.String pSchema, java.lang.String pTable) throws DataSourceException
getDefaultValuesIntern
in class DBAccess
pCatalog
- 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 exceptionprotected java.util.Map<java.lang.String,java.lang.Object[]> getAllowedValuesIntern(java.lang.String pCatalog, java.lang.String pSchema, java.lang.String pTable) throws DataSourceException
getAllowedValuesIntern
in class DBAccess
pCatalog
- the catalog namepSchema
- the schema namepTable
- the table to check
Hashtable
with a column name as key and the allowed values as array of Object
s or
null
if there are no allowed values
DataSourceException
- if the database access throws an exceptionprotected TableInfo getTableInfoIntern(java.lang.String pWriteBackTable) throws DataSourceException
getTableInfoIntern
in class DBAccess
pWriteBackTable
- 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 java.lang.Object executeFunction(java.lang.String pFunctionName, OutParam pReturnOutParam, java.lang.Object... pParameters) throws java.sql.SQLException
executeFunction
in class DBAccess
pFunctionName
- the function (optional with package) name.pReturnOutParam
- the return SQL Type (see Types
pParameters
- the parameters to use with the correct and corresponding java type.
java.sql.SQLException
- if the call failed.public void executeProcedure(java.lang.String pProcedureName, java.lang.Object... pParameters) throws java.sql.SQLException
executeProcedure
in class DBAccess
pProcedureName
- the procedure (optional with package) name.pParameters
- the parameters to use with the correct and corresponding java type.
java.sql.SQLException
- if the call failed.protected java.lang.Object[] insertOracle(java.lang.String pTablename, java.lang.String pInsertStatement, ServerMetaData pServerMetaData, java.lang.Object[] pNewDataRow, java.lang.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 storageprotected java.lang.String getTableForSynonymIntern(java.lang.String pStatement, java.lang.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 |