com.sibvisions.rad.persist.jdbc
Class PostgreSQLDBAccess

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

public class PostgreSQLDBAccess
extends DBAccess

The PostgreSQLDBAccess is the implementation for Postgres databases.

See Also:
DBAccess

Field Summary
 
Fields inherited from class com.sibvisions.rad.persist.jdbc.DBAccess
logger, LONGNVARCHAR, NCHAR, NCLOB, NVARCHAR, SQLXML
 
Constructor Summary
PostgreSQLDBAccess()
          Constructs a new OracleDBAccess Object.
 
Method Summary
 String getDatabaseSpecificLockStatement(String pWritebackTable, ServerMetaData pServerMetaData, ICondition pPKFilter)
          Returns the database specific statement to lock the specified row in the database.
 Hashtable<String,Object> getDefaultValues(String pCatalog, String pSchema, String pTable)
          Gets all default column values of a specific table.
 Object[] insertDatabaseSpecific(String pWritebackTable, String pInsertStatement, ServerMetaData pServerMetaData, Object[] pNewDataRow, String pDummyColumn)
          Returns the newly inserted row from an Database specific insert statement.
protected  Object translateDefaultValue(String pColumnName, int pDataType, String pDefaultValue)
          Translates a default value from a column to the datatype object.
 
Methods inherited from class com.sibvisions.rad.persist.jdbc.DBAccess
close, commit, delete, executeFunction, executeProcedure, executeUpdate, fetch, getAllowedValues, getAutomaticLinkColName, getAutomaticLinkColumnNameTranslation, getColumnMetaData, getConnection, getDBAccess, getDBProperties, getDBProperty, getDriver, getFKs, getFromClause, getMaxTime, getPassword, getPK, getPreparedStatement, getQueryColumns, getSelectStatement, getUKs, getUrl, getUsername, getWHEREClause, insert, insertAnsiSQL, isOpen, lockRow, lockRowInternal, open, quote, registerDBAccessClass, rollback, setAutomaticLinkColumnNameTranslation, setColumnsToStore, setDBProperties, setDBProperty, setDriver, setFilterParameter, setMaxTime, setPassword, setQueryTimeOut, setUrl, setUsername, supportsGetGeneratedKeys, toString, translateValue, update, updateAnsiSQL, updateDatabaseSpecific
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PostgreSQLDBAccess

public PostgreSQLDBAccess()
Constructs a new OracleDBAccess Object.

Method Detail

getDatabaseSpecificLockStatement

public String getDatabaseSpecificLockStatement(String pWritebackTable,
                                               ServerMetaData pServerMetaData,
                                               ICondition pPKFilter)
                                        throws DataSourceException
Returns the database specific statement to lock the specified row in the database.

Overrides:
getDatabaseSpecificLockStatement in class DBAccess
Parameters:
pWritebackTable - the table to use.
pServerMetaData - the MetaDataColumn array to use.
pPKFilter - the PK filter with the values to use.
Returns:
the database specific statement to lock the specified row in the database.
Throws:
DataSourceException - if some parts are missing for the statement

insertDatabaseSpecific

public Object[] insertDatabaseSpecific(String pWritebackTable,
                                       String pInsertStatement,
                                       ServerMetaData pServerMetaData,
                                       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
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

getDefaultValues

public Hashtable<String,Object> getDefaultValues(String pCatalog,
                                                 String pSchema,
                                                 String pTable)
                                          throws DataSourceException
Gets all default column values of a specific table.

Overrides:
getDefaultValues 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

translateDefaultValue

protected Object translateDefaultValue(String pColumnName,
                                       int pDataType,
                                       String pDefaultValue)
                                throws Exception
Translates a default value from a column to the datatype object.

Overrides:
translateDefaultValue in class DBAccess
Parameters:
pColumnName - the column name to translate
pDataType - the datatype of the column
pDefaultValue - the original default value from the database
Returns:
the default value with the datatype of the column or null if the default value is not valid
Throws:
Exception - if the type translation causes an error or the datatype is not supported


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.