com.sibvisions.rad.persist.jdbc
Class HSQLDBAccess

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

public class HSQLDBAccess
extends DBAccess

The HSQLDBAccess is the implementation for Hypersonic SQL 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
HSQLDBAccess()
          Constructs a new HSQLDBAccess 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 sCatalog, java.lang.String sSchema, java.lang.String pTable)
          Returns all Foreign Keys for the specified table.
protected  Key getPrimaryKeyIntern(java.lang.String sCatalog, java.lang.String sSchema, java.lang.String pTable)
          It's gets all Primary Key columns and return it as String[].
protected  java.util.List<Key> getUniqueKeysIntern(java.lang.String sCatalog, java.lang.String sSchema, java.lang.String pTable)
          It gets all columns for each Unique Key and return it.
 java.lang.String getWritebackTable(java.lang.String pWritebackTable)
          Returns the WritebackTable as toUpper, because of the meta data bug in HSQL.
protected  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.
 void open()
          It opens the database and stores the Connection object.
 
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, getQueryTimeout, getRealQueryColumnName, getSelectStatement, getSelectStatement, getSQL, getTableForSynonym, getTableForSynonymIntern, getTableInfo, getTableInfoIntern, getTransactionTimeout, getUniqueKeys, getUrl, getUsername, getWhereClause, info, initializeColumnMetaData, initializeDataType, initializeServerColumnMetaData, insert, insertAnsiSQL, 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, setUsername, 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

HSQLDBAccess

public HSQLDBAccess()
Constructs a new HSQLDBAccess 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

getPrimaryKeyIntern

protected Key getPrimaryKeyIntern(java.lang.String sCatalog,
                                  java.lang.String sSchema,
                                  java.lang.String pTable)
                           throws DataSourceException
It's gets all Primary Key columns and return it as String[]. Gets all Primary Key columns and return it as list of Strings.

Overrides:
getPrimaryKeyIntern in class DBAccess
Parameters:
sCatalog - the catalog to use
sSchema - the schema to use
pTable - the table to use
Returns:
all Primary Key columns and return it as String[].
Throws:
DataSourceException - if an error occur during PK search process.

getForeignKeysIntern

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

Overrides:
getForeignKeysIntern in class DBAccess
Parameters:
sCatalog - the catalog to use
sSchema - 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.

getUniqueKeysIntern

protected java.util.List<Key> getUniqueKeysIntern(java.lang.String sCatalog,
                                                  java.lang.String sSchema,
                                                  java.lang.String pTable)
                                           throws DataSourceException
It gets all columns for each Unique Key and return it.

Overrides:
getUniqueKeysIntern in class DBAccess
Parameters:
sCatalog - the catalog to use
sSchema - the schema to use
pTable - the table to use
Returns:
all columns for each Unique Key.
Throws:
DataSourceException - if an error occur during UK search process.

insertDatabaseSpecific

protected java.lang.Object[] insertDatabaseSpecific(java.lang.String pWritebackTable,
                                                    java.lang.String pInsertStatement,
                                                    ServerMetaData pServerMetaData,
                                                    java.lang.Object[] pNewDataRow,
                                                    java.lang.String pDummyColumn)
                                             throws DataSourceException
Returns the newly inserted row from a Database specific insert statement.
Database specific derivations of DBAccess need to implement it database specific.

Overrides:
insertDatabaseSpecific in class DBAccess
Parameters:
pWritebackTable - the table to use for the insert
pInsertStatement - the SQL Statement to use for the insert
pServerMetaData - the meta data to use.
pNewDataRow - the new row (Object[]) with the values to insert
pDummyColumn - null, if all writeable columns are null, but for a correct INSERT it have to be minimum one column to use in the syntax.
Returns:
the newly inserted row from an Oracle Database.
Throws:
DataSourceException - if an Exception occur during insert to the storage

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

getWritebackTable

public java.lang.String getWritebackTable(java.lang.String pWritebackTable)
Returns the WritebackTable as toUpper, because of the meta data bug in HSQL.

Parameters:
pWritebackTable - the write back tabel to use.
Returns:
the WritebackTable as toUpper, because of the meta data bug in HSQL.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.