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

public class HSQLDBAccess
extends DBAccess

The HSQLDBAccess is the implementation for Hypersonic SQL databases.

See Also:
DBAccess

Field Summary
 
Fields inherited from class com.sibvisions.rad.persist.jdbc.DBAccess
logger, LONGNVARCHAR, NCHAR, NCLOB, NVARCHAR, SQLXML
 
Constructor Summary
HSQLDBAccess()
          Constructs a new HSQLDBAccess Object.
 
Method Summary
 ColumnMetaData[] getColumnMetaData(String pFromClause, String[] pQueryColumns, String pBeforeQueryColumns, String pWhereClause, String pAfterWhereClause, String pWritebackTable, String[] pWritebackColumns, String[] pMetaDataContext)
          Returns the meta data for the specified query, and initials all columns.
 List<ForeignKey> getFKs(String sCatalog, String sSchema, String pTable)
          Returns all Foreign Keys for the specified table.
 String[] getPK(String sCatalog, String sSchema, String pTable)
          It's gets all Primary Key columns and return it as String[].
 List<String[]> getUKs(String sCatalog, String sSchema, String pTable)
          It's gets all columns for each Unique Key and return it.
 String getWritebackTable(String pWritebackTable)
          Returns the WritebackTable as toUpper, because of the meta data bug in HSQL.
 Object[] insertDatabaseSpecific(String pWritebackTable, String pInsertStatement, MetaData pMetaData, Object[] pNewDataRow, String pDummyColumn)
          Returns the newly inserted row from an Database specific insert statement.
 
Methods inherited from class com.sibvisions.rad.persist.jdbc.DBAccess
close, commit, delete, executeFunction, executeProcedure, executeUpdate, fetch, getAutomaticLinkColName, getConnection, getDatabaseSpecificLockStatement, getDBAccess, getDBProperties, getDBProperty, getDriver, getFromClause, getMaxTime, getPassword, getPreparedStatement, getQueryColumns, getSelectStatement, getUrl, getUsername, getWHEREClause, insert, insertAnsiSQL, isOpen, lockRow, open, quote, registerDBAccessClass, rollback, setColumnsToStore, setDBProperties, setDBProperty, setDriver, setFilterParameter, setMaxTime, setPassword, setQueryTimeOut, setUrl, setUsername, supportsGetGeneratedKeys, toString, update
 
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

getPK

public String[] getPK(String sCatalog,
                      String sSchema,
                      String pTable)
               throws DataSourceException
It's gets all Primary Key columns and return it as String[].

Overrides:
getPK 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.

getFKs

public List<ForeignKey> getFKs(String sCatalog,
                               String sSchema,
                               String pTable)
                        throws DataSourceException
Returns all Foreign Keys for the specified table.

Overrides:
getFKs 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.

getUKs

public List<String[]> getUKs(String sCatalog,
                             String sSchema,
                             String pTable)
                      throws DataSourceException
It's gets all columns for each Unique Key and return it.

Overrides:
getUKs 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.

getColumnMetaData

public ColumnMetaData[] getColumnMetaData(String pFromClause,
                                          String[] pQueryColumns,
                                          String pBeforeQueryColumns,
                                          String pWhereClause,
                                          String pAfterWhereClause,
                                          String pWritebackTable,
                                          String[] pWritebackColumns,
                                          String[] pMetaDataContext)
                                   throws DataSourceException
Returns the meta data for the specified query, and initials all columns.

Overrides:
getColumnMetaData in class DBAccess
Parameters:
pFromClause - the from clause with query tables and join definitions
pQueryColumns - the query columns
pBeforeQueryColumns - the before query columns
pWhereClause - the last where condition in query
pAfterWhereClause - the after where clause in query
pWritebackTable - the write back table to use for the isWriteable() state (Optional)
pWritebackColumns - the write back columns to use for the isWriteable() state (Optional)
pMetaDataContext - if an String[] with length == 2 is used, the methods returns the MetaData Context back. That's in [0] the Catalog and in [1] the Schema of the pMetaDataQuery, if possible.
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 isn't opened or if one columns SQL type isn't supported

insertDatabaseSpecific

public Object[] insertDatabaseSpecific(String pWritebackTable,
                                       String pInsertStatement,
                                       MetaData pMetaData,
                                       Object[] pNewDataRow,
                                       String pDummyColumn)
                                throws DataSourceException
Returns the newly inserted row from an Database specific insert statement.
Database specific derivations of DBAcces 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
pMetaData - 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

getWritebackTable

public String getWritebackTable(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.