com.sibvisions.rad.persist.jdbc
Class DB2DBAccess

java.lang.Object
  extended by com.sibvisions.rad.persist.jdbc.DBAccess
      extended by com.sibvisions.rad.persist.jdbc.DB2DBAccess
All Implemented Interfaces:
IDBAccess, ICloseable

public class DB2DBAccess
extends DBAccess

The DB2DBAccess is the implementation for DB2 databases.

See Also:
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
DB2DBAccess()
          Constructs a new DB2DBAccess Object.
 
Method Summary
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  java.lang.String getTableForSynonymIntern(java.lang.String pSynomyn)
          Returns the full qualified table name incl. schema/catalog/db link for the given synonym.
protected  TableInfo getTableInfoIntern(java.lang.String pWriteBackTable)
          Returns the meta data information for the specified query, and configures all columns with defaults.
protected  void initializeDataType(java.sql.ResultSetMetaData pResultSetMetaData, int pResultSetColumnIndex, ColumnMetaData pColumnMetaData)
          Initializes the datatype data of the ColumnMetaData with the given ResultSetMetaData.
 void open()
          It opens the database and stores the Connection object.
 void setUsername(java.lang.String pUsername)
          Sets the user name to connect with.
 
Methods inherited from class com.sibvisions.rad.persist.jdbc.DBAccess
clearMetaData, clearMetaData, close, commit, commitOrRollbackBeforeClose, convertDatabaseSpecificObjectToValue, convertValueToDatabaseSpecificObject, createIdentifier, createReplace, createServerColumnMetaData, createWhereColumn, createWhereParam, debug, delete, detectModified, error, eventConfigureConnection, eventUnconfigureConnection, executeFunction, executeFunction, executeProcedure, executeQuery, executeSql, executeSqlMulti, executeStatement, fetch, fetch, fetch, fetch, findAndCreateReducedCondition, findNamedParameters, fireEventConfigureConnection, fireEventUnconfigureConnection, formatSQLException, formatSQLException, getAllowedValues, getAllowedValuesIntern, getAutomaticLinkColumnNameTranslation, getCloseQuoteCharacter, getColumnMetaData, getColumnMetaDataCreator, getColumnMetaDataIntern, getColumnName, getConnection, getConnectionIntern, getConnectionPool, getDatabaseSpecificLockStatement, getDBAccess, getDBAccess, getDBAccess, getDBAccess, getDBAccess, getDBProperties, getDBProperty, getDefaultAllowedValues, getDefaultCursorCacheTimeout, getDefaultLargeObjectLimit, getDefaultSchema, getDefaultValues, getDiscardRowCount, getDriver, getForeignKeys, getIdentifier, getLargeObjectLimit, getMaxColumnLength, getMaxTime, getMetaDataCacheOption, getMetaDataWhereClause, getObjectFromResultSet, getObjectFromResultSet, getOpenQuoteCharacter, getParameter, getParameter, getParameterizedSelectStatement, getPassword, getPreparedStatement, getPreparedStatement, getPrimaryKey, getPrimaryKeyIntern, getQueryTimeout, getRealQueryColumnName, getSelectStatement, getSelectStatement, getSQL, getTableForSynonym, getTableInfo, getTransactionTimeout, getUniqueKeys, getUniqueKeysIntern, getUrl, getUsername, getWhereClause, info, initializeColumnMetaData, initializeServerColumnMetaData, insert, insertAnsiSQL, insertDatabaseSpecific, isAutoCommit, isAutoQuote, isConnectionPoolEnabled, isJdbc, isLogEnabled, isMetaDataCacheEnabled, isModified, isOpen, isReleaseConnectionPending, isTypeEqual, lockRow, lockRowInternal, prepareConnection, quote, quoteAllways, registerDBAccessClass, releaseConnection, releaseConnectionIntern, removeDBSpecificQuotes, removeQuotes, rollback, setAutoCommit, setAutomaticLinkColumnNameTranslation, setColumnMetaDataCreator, setColumnMetaDataCreator, setColumnsToStore, setConnection, setConnectionPool, setConnectionPoolEnabled, setDBProperties, setDBProperty, setDefaultCursorCacheTimeout, setDefaultLargeObjectLimit, setDefaultSchema, setDriver, setLargeObjectLimit, setMaxTime, setMetaDataCacheOption, setModified, setPassword, setQueryTimeout, setQuoteCharacters, setTransactionTimeout, setUrl, splitSchemaTable, supportsGetGeneratedKeys, toString, translateDefaultValue, translateQuotes, translateValue, update, updateAnsiSQL, updateDatabaseSpecific
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DB2DBAccess

public DB2DBAccess()
Constructs a new DB2DBAccess Object.

Method Detail

open

public void open()
          throws DataSourceException
It opens the database and stores the Connection object.

Overrides:
open in class DBAccess
Throws:
DataSourceException - if the database couldn't opened

setUsername

public void setUsername(java.lang.String pUsername)
Description copied from class: DBAccess
Sets the user name to connect with.

Overrides:
setUsername in class DBAccess
Parameters:
pUsername - the user name

getDefaultValuesIntern

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
Gets all default column values of a specific table.

Overrides:
getDefaultValuesIntern in class DBAccess
Parameters:
pCatalog - the catalog name
pSchema - the schema name
pTable - the table name
Returns:
a Hashtable with the column name as key and the default value as value. It only contains columns with a default value
Throws:
DataSourceException - if the database access throws an exception

getTableInfoIntern

protected TableInfo getTableInfoIntern(java.lang.String pWriteBackTable)
                                throws DataSourceException
Returns the meta data information for the specified query, and configures all columns with defaults.

Overrides:
getTableInfoIntern in class DBAccess
Parameters:
pWriteBackTable - the write back table to use for the isWriteable() state (Optional)
Returns:
the meta data for the specified query, and initials all columns.
Throws:
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 supported

getForeignKeysIntern

protected java.util.List<ForeignKey> getForeignKeysIntern(java.lang.String pCatalog,
                                                          java.lang.String pSchema,
                                                          java.lang.String pTable)
                                                   throws DataSourceException
Returns all Foreign Keys for the specified table.

Overrides:
getForeignKeysIntern in class DBAccess
Parameters:
pCatalog - the catalog to use
pSchema - the schema to use
pTable - the table to use as base table.
Returns:
all Foreign Keys for the specified table.
Throws:
DataSourceException - if an error occur in determining the ForeignKeys.

getTableForSynonymIntern

protected java.lang.String getTableForSynonymIntern(java.lang.String pSynomyn)
                                             throws DataSourceException
Returns the full qualified table name incl. schema/catalog/db link for the given synonym. If pSynomyn is no synonym, then the pSynomyn string is returned.

Overrides:
getTableForSynonymIntern in class DBAccess
Parameters:
pSynomyn - the synonym to use.
Returns:
the full qualified table name incl. schema/catalog/db link for the given synonym.
Throws:
DataSourceException - if an error occur in determining the synonyms.

initializeDataType

protected void initializeDataType(java.sql.ResultSetMetaData pResultSetMetaData,
                                  int pResultSetColumnIndex,
                                  ColumnMetaData pColumnMetaData)
                           throws java.sql.SQLException,
                                  DataSourceException
Initializes the datatype data of the ColumnMetaData with the given ResultSetMetaData.

Overrides:
initializeDataType in class DBAccess
Parameters:
pResultSetMetaData - the result set meta data.
pResultSetColumnIndex - the column index.
pColumnMetaData - the ColumnMetaData
Throws:
java.sql.SQLException - if an unwanted SQLException occurs
DataSourceException - if an know problem occurs during creation


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.