| java.lang.Object org.griphyn.vdl.dbdriver.DatabaseDriver org.griphyn.vdl.dbdriver.SQLite
SQLite | public class SQLite extends DatabaseDriver (Code) | | This class implements the driver API for the free, small, and fast
file-based SQL Lite. This class is currently an empty non-working
stand-in. Refer to the SQLite
site for details. We will fill this stand-in with life at some
later time.
In order to use the SQLite driver, you must install the SQLite
software first. Additionally, it is necessary to install the
Java SQLite wrapper, which comes in two part. The JAR file is
included with the VDS distribution. However, it is also necessary
to either install the shared JNI library into your Java runtime, or
point your LD_LIBRARY_PATH to the shared library.
author: Jens-S. Vöckler author: Yong Zhao version: $Revision: 50 $ See Also: DatabaseDriver See Also: org.griphyn.vdl.dbschema |
Constructor Summary | |
public | SQLite() 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 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 has this problem, but using strings in the place of
integers may not be universally portable.
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. |
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 has this problem, but using strings in the place of
integers may not be universally portable.
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. SQLite prefers NULL-driven
auto-increment columns, so this function will always return -1.
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. SQLite uses
NULL-driven auto-increment column. Thus, we do the heavy lifting
here.
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)
|
|
|