|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.triactive.jdo.store.adapter.DatabaseAdapter
com.triactive.jdo.store.adapter.PostgresqlAdapter
Provides methods for adapting SQL language elements to the PostgreSQL database.
Field Summary |
Fields inherited from class com.triactive.jdo.store.adapter.DatabaseAdapter |
dbid, identifierQuoteString, keywords, maxCatalogNameLength, maxColumnNameLength, maxConstraintNameLength, maxCorrelationNameLength, maxIndexNameLength, maxSchemaNameLength, maxTableNameLength, storesLowerCaseIdentifiers, storesUpperCaseIdentifiers, supportsCorrelatedSubqueries, supportsGroupByUnrelated, supportsOrderByUnrelated, supportsSubqueriesInExists, supportsSubqueriesInIns, typeMappings, types |
Constructor Summary | |
PostgresqlAdapter()
|
Method Summary | |
protected void |
adaptTo(DatabaseIdentifier dbid,
java.sql.DatabaseMetaData metadata)
Initializes the database adapter based on the given JDBC metadata. |
java.lang.String |
getDropTableStatement(BaseTable table)
Returns the appropriate SQL to drop the given table. |
protected java.lang.String |
getQueryCurrentSchemaNameStatement()
Returns a statement that will return the name of the current schema. |
protected java.lang.String |
getQueryCurrentTimestampStatement()
Returns a statement that will return a timestamp reflecting the database's current date and time. |
SqlState |
getSqlState(java.sql.SQLException se)
Returns a SqlState object for the specified SQLException, if one is present and valid. |
ColumnInfo |
newColumnInfo(java.sql.ResultSet rs)
A factory for ColumnInfo objects. |
ForeignKeyInfo |
newForeignKeyInfo(java.sql.ResultSet rs)
A factory for ForeignKeyInfo objects. |
TypeInfo |
newTypeInfo(java.sql.ResultSet rs,
int row)
A factory for TypeInfo objects. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public PostgresqlAdapter()
Method Detail |
protected void adaptTo(DatabaseIdentifier dbid, java.sql.DatabaseMetaData metadata) throws java.sql.SQLException
DatabaseAdapter
adaptTo
in class DatabaseAdapter
dbid
- the database identifiermetadata
- the database metadata
java.sql.SQLException
protected java.lang.String getQueryCurrentSchemaNameStatement()
DatabaseAdapter
getQueryCurrentSchemaNameStatement
in class DatabaseAdapter
protected java.lang.String getQueryCurrentTimestampStatement()
DatabaseAdapter
getQueryCurrentTimestampStatement
in class DatabaseAdapter
public SqlState getSqlState(java.sql.SQLException se)
DatabaseAdapter
getSqlState
in class DatabaseAdapter
se
- A caught SQL exception.
null
if se does not
contain a valid 5-character SQLSTATE.public TypeInfo newTypeInfo(java.sql.ResultSet rs, int row) throws java.sql.SQLException
DatabaseAdapter
ResultSet
object passed must have been
obtained from a call to DatabaseMetaData.getTypeInfo().
The constructor only retrieves the values from the current row; the
caller is required to advance to the next row with ResultSet.next()
.
newTypeInfo
in class DatabaseAdapter
rs
- The result set returned from DatabaseMetaData.getTypeInfo().row
- The current row number in the result set. The first row is 1.
null
if the type indicated by this row should be
excluded from use.
java.sql.SQLException
- If a database error occurs.public ColumnInfo newColumnInfo(java.sql.ResultSet rs) throws java.sql.SQLException
DatabaseAdapter
The column information object is constructed from the current row of the given result set. The result set passed must have been obtained from a call to DatabaseMetaData.getColumns().
The constructor only retrieves the values from the current row; the
caller is required to advance to the next row with ResultSet.next()
.
newColumnInfo
in class DatabaseAdapter
rs
- The result set returned from DatabaseMetaData.getColumns().
java.sql.SQLException
- If a database error occurs.public ForeignKeyInfo newForeignKeyInfo(java.sql.ResultSet rs) throws java.sql.SQLException
DatabaseAdapter
The column information object is constructed from the current row of the given result set. The result set passed must have been obtained from a call to DatabaseMetaData.getImportedKeys() or DatabaseMetaData.getExportedKeys().
The constructor only retrieves the values from the current row; the
caller is required to advance to the next row with ResultSet.next()
.
newForeignKeyInfo
in class DatabaseAdapter
rs
- The result set returned from DatabaseMetaData.get??portedKeys().
java.sql.SQLException
- If a database error occurs.public java.lang.String getDropTableStatement(BaseTable table)
DatabaseAdapter
DROP TABLE FOO CASCADE
getDropTableStatement
in class DatabaseAdapter
table
- The table to drop.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |