|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jminor.common.db.AbstractDatabase
org.jminor.common.db.dbms.PostgreSQLDatabase
public final class PostgreSQLDatabase
A Database implementation based on the PostgreSQL database.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.jminor.common.db.Database |
---|
Database.Statistics |
Field Summary |
---|
Fields inherited from interface org.jminor.common.db.Database |
---|
DATABASE_EMBEDDED, DATABASE_HOST, DATABASE_IMPLEMENTATION_CLASS, DATABASE_POOL_STATISTICS, DATABASE_PORT, DATABASE_SID, DATABASE_TYPE, DEFAULT_LOGIN_TIMEOUT, DERBY, H2, HSQL, MYSQL, ORACLE, PASSWORD_PROPERTY, POSTGRESQL, SQLSERVER, USER_PROPERTY |
Constructor Summary | |
---|---|
PostgreSQLDatabase()
Instantiates a new PostgreDatabase. |
|
PostgreSQLDatabase(String host,
String port,
String database)
Instantiates a new PostgreDatabase. |
Method Summary | |
---|---|
String |
getAutoIncrementValueSQL(String idSource)
Returns a query string for retrieving the last automatically generated id from the given id source |
String |
getCheckConnectionQuery()
Returns a query to use when checking if the connection is valid, this is used in cases where the dbms does not support the isValid() call. |
String |
getSequenceSQL(String sequenceName)
|
String |
getURL(Properties connectionProperties)
|
void |
loadDriver()
Loads the database driver |
boolean |
supportsIsValid()
|
Methods inherited from class org.jminor.common.db.AbstractDatabase |
---|
addConnectionProperties, createConnection, getAuthenticationInfo, getDatabaseType, getErrorMessage, getHost, getLoginTimeout, getPort, getSid, isEmbedded, shutdownEmbedded, supportsNowait |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PostgreSQLDatabase()
public PostgreSQLDatabase(String host, String port, String database)
host
- the host nameport
- the port numberdatabase
- the database nameMethod Detail |
---|
public void loadDriver() throws ClassNotFoundException
ClassNotFoundException
- in case the driver class in not foundpublic String getAutoIncrementValueSQL(String idSource)
idSource
- the source for the id, for example a sequence name or in the case of Derby, the name of the table
public String getSequenceSQL(String sequenceName)
getSequenceSQL
in interface Database
getSequenceSQL
in class AbstractDatabase
sequenceName
- the name of the sequence
public String getURL(Properties connectionProperties)
connectionProperties
- the connection properties, used primarily to provide
embedded databases with user info for authentication purposes
public boolean supportsIsValid()
AbstractDatabase
supportsIsValid
in interface Database
supportsIsValid
in class AbstractDatabase
public String getCheckConnectionQuery()
getCheckConnectionQuery
in interface Database
getCheckConnectionQuery
in class AbstractDatabase
Database.supportsIsValid()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |