|
||||||||||
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.DB2DBAccess
public class DB2DBAccess
The DB2DBAccess
is the implementation for DB2 databases.
DBAccess
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.sibvisions.rad.persist.jdbc.DBAccess |
---|
DBAccess.ColumnMetaDataInfo |
Field Summary |
---|
Fields inherited from class com.sibvisions.rad.persist.jdbc.DBAccess |
---|
logger, LONGNVARCHAR, NCHAR, NCLOB, NVARCHAR, QUOTE, SQLXML |
Constructor Summary | |
---|---|
DB2DBAccess()
Constructs a new DB2DBAccess Object. |
Method Summary | |
---|---|
DBAccess.ColumnMetaDataInfo |
getColumnMetaData(String pFromClause,
String[] pQueryColumns,
String pBeforeQueryColumns,
String pWhereClause,
String pAfterWhereClause,
String pWritebackTable,
String[] pWritebackColumns)
Returns the meta data information for the specified query, and configures all columns with defaults. |
Hashtable<String,Object> |
getDefaultValues(String pCatalog,
String pSchema,
String pTable)
Gets all default column values of a specific table. |
List<ForeignKey> |
getFKs(String pCatalog,
String pSchema,
String pTable)
Returns all Foreign Keys for the specified table. |
String |
getTableForSynonym(String pSynomyn)
Returns the full qualified table name incl. schema/catalog/db link for the given synonym. |
void |
open()
It opens the database and stores the Connection object. |
protected boolean |
setDatabaseSpecificType(ResultSetMetaData pMetaData,
int pColumnIndex,
ServerColumnMetaData pColumnMetaData)
Enables the database specific implementation to change the metadata before the default settings are made. |
void |
setUsername(String pUsername)
Sets the user name to connect with. |
protected Object |
translateDefaultValue(String pColumnName,
int pDataType,
String pDefaultValue)
Translates a default value from a column to the datatype object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DB2DBAccess()
Method Detail |
---|
public void open() throws DataSourceException
Connection
object.
open
in class DBAccess
DataSourceException
- if the database couldn't openedpublic void setUsername(String pUsername)
DBAccess
setUsername
in class DBAccess
pUsername
- the user namepublic Hashtable<String,Object> getDefaultValues(String pCatalog, String pSchema, String pTable) throws DataSourceException
getDefaultValues
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 Object translateDefaultValue(String pColumnName, int pDataType, String pDefaultValue) throws Exception
translateDefaultValue
in class DBAccess
pColumnName
- the column name to translatepDataType
- the datatype of the columnpDefaultValue
- the original default value from the database
null
if the default value is not valid
Exception
- if the type translation causes an error or the datatype is not supportedpublic DBAccess.ColumnMetaDataInfo getColumnMetaData(String pFromClause, String[] pQueryColumns, String pBeforeQueryColumns, String pWhereClause, String pAfterWhereClause, String pWritebackTable, String[] pWritebackColumns) throws DataSourceException
getColumnMetaData
in class DBAccess
pFromClause
- the from clause with query tables and join definitionspQueryColumns
- the query columnspBeforeQueryColumns
- the before query columnspWhereClause
- the last where condition in querypAfterWhereClause
- the after where clause in querypWritebackTable
- the write back table to use for the isWriteable() state (Optional)pWritebackColumns
- the write back columns 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 supportedpublic List<ForeignKey> getFKs(String pCatalog, String pSchema, String pTable) throws DataSourceException
getFKs
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.public String getTableForSynonym(String pSynomyn) throws DataSourceException
getTableForSynonym
in class DBAccess
pSynomyn
- the synonym to use.
DataSourceException
- if an error occur in determining the synonyms.protected boolean setDatabaseSpecificType(ResultSetMetaData pMetaData, int pColumnIndex, ServerColumnMetaData pColumnMetaData) throws SQLException
setDatabaseSpecificType
in class DBAccess
pMetaData
- the metadata from the resultsetpColumnIndex
- the column index in the resultset metadatapColumnMetaData
- the newly created and pre-configured column metadata
true
if column metadata are changed and the default settings should not be applied,
false
to apply the standard settings
SQLException
- if metadata access fails
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |