| java.lang.Object org.griphyn.vdl.dbdriver.DatabaseDriver org.griphyn.vdl.dbdriver.Postgres
Postgres | public class Postgres extends DatabaseDriver (Code) | | This class implements the driver API for the PostGreSQL 7.3.* and
7.4.* series database. Please note that at this point, we cannot
recommend to use Postgres 8.0.*.
author: Jens-S. Vöckler author: Yong Zhao version: $Revision: 50 $ See Also: DatabaseDriver See Also: org.griphyn.vdl.dbschema |
Constructor Summary | |
public | Postgres() Default constructor. |
Method Summary | |
public boolean | cachingMakesSense() Determines, if the backend is expensive, and results should be cached. | public boolean | connect(String url, Properties info, Set tables) Establish a connection to your database. | public void | driverMatch() Determines, if the JDBC driver is the right one for the database we
talk to. | public boolean | preferString() Predicate to tell the schema, if using a string instead of number
will result in the speedier index scans instead of sequential scans.
PostGreSQL suffers from this problem.
true, if using strings instead of integers and bigintswill yield better performance. | public String | quote(String s) Quotes a string that may contain special SQL characters.
Parameters: s - is the raw string. | public long | sequence1(String name) Obtains the next value from a sequence. | public long | sequence2(Statement s, String name, int pos) Obtains the sequence value for the current statement. |
cachingMakesSense | public boolean cachingMakesSense()(Code) | | Determines, if the backend is expensive, and results should be cached.
Ideally, this will move transparently into the backend itself.
true if caching is advisable, false for no caching. |
connect | public boolean connect(String url, Properties info, Set tables) throws SQLException, ClassNotFoundException(Code) | | Establish a connection to your database. The parameters will often
be ignored or abused for different purposes on different backends.
It is assumed that the connection is not in auto-commit mode, and
explicit commits must be issued.
Parameters: url - the contact string to database, or schema location Parameters: info - additional parameters, usually username and password Parameters: tables - is a set of all table names in the schema. Theexistence of all tables will be checked to verifythat the schema is active in the database. true if the connection succeeded, false otherwise. Usually,false is returned, if the any of the tables or sequences is missing. if the driver is incapable of establishing a connection. |
driverMatch | public void driverMatch() throws SQLException(Code) | | Determines, if the JDBC driver is the right one for the database we
talk to. Throws an exception if not.
|
preferString | public boolean preferString()(Code) | | Predicate to tell the schema, if using a string instead of number
will result in the speedier index scans instead of sequential scans.
PostGreSQL suffers from this problem.
true, if using strings instead of integers and bigintswill yield better performance. |
quote | public String quote(String s)(Code) | | Quotes a string that may contain special SQL characters.
Parameters: s - is the raw string. the quoted string, which may be just the input string. |
sequence1 | public long sequence1(String name) throws SQLException(Code) | | Obtains the next value from a sequence. Postgres uses explicit
sequence generators, so this function will return the new id.
Parameters: name - is the name of the sequence. the next sequence number. if something goes wrong while fetching the new value. |
sequence2 | public long sequence2(Statement s, String name, int pos) throws SQLException(Code) | | Obtains the sequence value for the current statement. Postgres does
not permit NULL-driven auto-increment columns. Postgres uses
explicit sequence generators, so this function always returns -1.
Parameters: s - is a statment or prepared statement Parameters: name - is the name of the sequence. Parameters: pos - is the column number of the auto-increment column. the next sequence number. if something goes wrong while fetching the new value. |
Methods inherited from org.griphyn.vdl.dbdriver.DatabaseDriver | public boolean addPreparedStatement(String id, String statement) throws SQLException(Code)(Java Doc) protected boolean addPreparedStatement(String id, String statement, boolean autoGeneratedKeys) throws SQLException(Code)(Java Doc) public ResultSet backdoor(String query) throws SQLException(Code)(Java Doc) abstract public boolean cachingMakesSense()(Code)(Java Doc) public void cancelPreparedStatement(String id) throws SQLException, ArrayIndexOutOfBoundsException(Code)(Java Doc) public void clearWarnings() throws SQLException(Code)(Java Doc) public void commit() throws SQLException(Code)(Java Doc) protected boolean connect(String driver, String url, Properties info, Set tables) throws SQLException, ClassNotFoundException(Code)(Java Doc) abstract public boolean connect(String url, Properties info, Set tables) throws SQLException, ClassNotFoundException(Code)(Java Doc) public int delete(String table, Map columns) throws SQLException(Code)(Java Doc) public void disconnect() throws SQLException(Code)(Java Doc) public void driverMatch() throws SQLException(Code)(Java Doc) protected void finalize() throws Throwable(Code)(Java Doc) public PreparedStatement getPreparedStatement(String id) throws SQLException(Code)(Java Doc) public SQLWarning getWarnings() throws SQLException(Code)(Java Doc) public long insert(String table, Map keycolumns, Map columns) throws SQLException(Code)(Java Doc) public boolean insertPreparedStatement(String id, String statement) throws SQLException(Code)(Java Doc) public static DatabaseDriver loadDriver(String dbDriverName, String propertyPrefix, Object[] arguments) throws ClassNotFoundException, IOException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException, SQLException(Code)(Java Doc) public static DatabaseDriver loadDriver(String propertyPrefix) throws ClassNotFoundException, IOException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException, SQLException(Code)(Java Doc) abstract public boolean preferString()(Code)(Java Doc) public String quote(String s)(Code)(Java Doc) public void removePreparedStatement(String id) throws SQLException(Code)(Java Doc) public void rollback() throws SQLException(Code)(Java Doc) public ResultSet select(List select, String table, Map where, String order) throws SQLException(Code)(Java Doc) public ResultSet select(List select, String table, Map where, Map operator, String order) throws SQLException(Code)(Java Doc) abstract public long sequence1(String name) throws SQLException(Code)(Java Doc) abstract public long sequence2(Statement s, String name, int pos) throws SQLException(Code)(Java Doc) public int update(String table, Map keycolumns, Map columns) throws SQLException(Code)(Java Doc)
|
|
|