|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.empire.db.DBDatabaseDriver
org.apache.empire.db.postgresql.DBDatabaseDriverPostgreSQL
public class DBDatabaseDriverPostgreSQL
This class provides support for the PostgreSQL database system.
Nested Class Summary | |
---|---|
static class |
DBDatabaseDriverPostgreSQL.DBCommandPostreSQL
Defines the PostgreSQL command type. |
Nested classes/interfaces inherited from class org.apache.empire.db.DBDatabaseDriver |
---|
DBDatabaseDriver.DBSeqTable, DBDatabaseDriver.DBSetGenKeys |
Field Summary |
---|
Constructor Summary | |
---|---|
DBDatabaseDriverPostgreSQL()
Constructor for the PostgreSQL database driver. |
Method Summary | |
---|---|
DBCommand |
createCommand(DBDatabase db)
Creates a new PostgreSQL command object. |
void |
createReverseFunction(Connection conn)
Creates the reverse function in postgre sql that returns the reverse of a string value. |
String |
getConvertPhrase(DataType destType,
DataType srcType,
Object format)
Returns a data type convertion phrase template for this driver The returned template must contain a '?' which will be replaced by a column expression. |
String |
getDatabaseName()
returns the name for the database / schema |
void |
getDDLScript(DBCmdType type,
DBObject dbo,
DBSQLScript script)
Gets a SQL command for creating, modifying or deleting objects in the database (tables, columns, constraints, etc.) |
Object |
getNextSequenceValue(DBDatabase db,
String seqName,
int minValue,
Connection conn)
Returns the next value of a named sequence The numbers are used for fields of type DBExpr.DT_AUTOINC. If a driver supports this function it must return true for isSupported(DBDriverFeature.SEQUENCES). |
Object |
getResultValue(ResultSet rset,
int columnIndex,
DataType dataType)
Postgre needs special handling for CLOBs and BLOB's |
String |
getSQLPhrase(int phrase)
Gets an sql phrase template for this database system. |
Timestamp |
getUpdateTimestamp(Connection conn)
Overridden. |
boolean |
isSupported(DBDriverFeature type)
Returns whether or not a particular feature is supported by this driver |
void |
setDatabaseName(String databaseName)
Sets the name for the database / schema This names is required for creating a database. When a name is set, the driver will automatically execute 'USE dbname' when the database is opened. |
Methods inherited from class org.apache.empire.db.DBDatabaseDriver |
---|
addStatementParam, appendElementName, appendElementName, appendSQLTextValue, attachDatabase, checkDatabase, close, createCombinedCommand, detachDatabase, detectQuoteName, executeQuery, executeSQL, extractErrorMessage, getColumnAutoValue, getSQLDateTimeString, getSQLTextString, getValueString, isDDLColumnDefaults, prepareStatement, setDDLColumnDefaults, stringToBoolean |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DBDatabaseDriverPostgreSQL()
Method Detail |
---|
public String getDatabaseName()
public void setDatabaseName(String databaseName)
databaseName
- the name of the databasepublic void createReverseFunction(Connection conn)
conn
- a valid database connectionpublic DBCommand createCommand(DBDatabase db)
createCommand
in class DBDatabaseDriver
db
- the database for which to create a command object for
public boolean isSupported(DBDriverFeature type)
isSupported
in class DBDatabaseDriver
type
- type of requested feature. @see DBDriverFeature
public String getSQLPhrase(int phrase)
getSQLPhrase
in class DBDatabaseDriver
phrase
- the identifier of the phrase
DBDatabaseDriver.getSQLPhrase(int)
public String getConvertPhrase(DataType destType, DataType srcType, Object format)
DBDatabaseDriver
getConvertPhrase
in class DBDatabaseDriver
destType
- the target data typesrcType
- the source data typeformat
- additional formatting information (optional)
DBDatabaseDriver.getConvertPhrase(DataType, DataType, Object)
public Object getNextSequenceValue(DBDatabase db, String seqName, int minValue, Connection conn)
DBDatabaseDriver
getNextSequenceValue
in class DBDatabaseDriver
db
- the databaseseqName
- the name of the sequenceminValue
- the minimum value of the sequenceconn
- a valid database connection
DBDatabaseDriver.getNextSequenceValue(DBDatabase, String, int, Connection)
public Timestamp getUpdateTimestamp(Connection conn)
getUpdateTimestamp
in class DBDatabaseDriver
conn
- the connection that might be used
public void getDDLScript(DBCmdType type, DBObject dbo, DBSQLScript script)
DBDatabaseDriver
getDDLScript
in class DBDatabaseDriver
type
- the command typedbo
- the database objectscript
- the script to completeDBDatabaseDriver.getDDLScript(DBCmdType, DBObject, DBSQLScript)
public Object getResultValue(ResultSet rset, int columnIndex, DataType dataType) throws SQLException
getResultValue
in class DBDatabaseDriver
rset
- the sql Resultset with the current data rowcolumnIndex
- one based column Index of the desired columndataType
- the required data type
SQLException
- if a database access error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |