|
||||||||||
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.HSQLDBAccess
public class HSQLDBAccess
The HSQLDBAccess
is the implementation for Hypersonic SQL 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 | |
---|---|
HSQLDBAccess()
Constructs a new HSQLDBAccess 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 sCatalog,
String sSchema,
String pTable)
Returns all Foreign Keys for the specified table. |
Key |
getPK(String sCatalog,
String sSchema,
String pTable)
Gets all Primary Key columns and return it as list of Strings. |
List<Key> |
getUKs(String sCatalog,
String sSchema,
String pTable)
It 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,
ServerMetaData pServerMetaData,
Object[] pNewDataRow,
String pDummyColumn)
Returns the newly inserted row from an Database specific insert statement. |
void |
open()
It opens the database and stores the Connection object. |
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 HSQLDBAccess()
Method Detail |
---|
public void open() throws DataSourceException
Connection
object.
open
in class DBAccess
DataSourceException
- if the database couldn't openedpublic Key getPK(String sCatalog, String sSchema, String pTable) throws DataSourceException
getPK
in class DBAccess
sCatalog
- the catalog to usesSchema
- the schema to usepTable
- the table to use
DataSourceException
- if an error occur during PK search process.public List<ForeignKey> getFKs(String sCatalog, String sSchema, String pTable) throws DataSourceException
getFKs
in class DBAccess
sCatalog
- the catalog to usesSchema
- the schema to usepTable
- the table to use as base table.
DataSourceException
- if an error occur in determining the ForeignKeys.public List<Key> getUKs(String sCatalog, String sSchema, String pTable) throws DataSourceException
getUKs
in class DBAccess
sCatalog
- the catalog to usesSchema
- the schema to usepTable
- the table to use
DataSourceException
- if an error occur during UK search process.public 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 Object[] insertDatabaseSpecific(String pWritebackTable, String pInsertStatement, ServerMetaData pServerMetaData, Object[] pNewDataRow, 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 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 String getWritebackTable(String pWritebackTable)
pWritebackTable
- the write back tabel to use.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |