| java.lang.Object org.griphyn.vdl.dbdriver.DatabaseDriver org.griphyn.vdl.dbdriver.MySQL
MySQL | public class MySQL extends DatabaseDriver (Code) | | This class implements the driver API for the MySQL 4.* database.
author: Jens-S. Vöckler author: Yong Zhao version: $Revision: 50 $ See Also: DatabaseDriver See Also: org.griphyn.vdl.dbschema |
Field Summary | |
boolean | m_lockSequenceTable Maintains the property, if locking of sequence table is required. |
Constructor Summary | |
public | MySQL() 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.
Parameters: name - is the name of the sequence. | public long | sequence2(Statement s, String name, int pos) Obtains the sequence value for the current statement. |
m_lockSequenceTable | boolean m_lockSequenceTable(Code) | | Maintains the property, if locking of sequence table is required.
|
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. exception: SQLException - if the driver is incapable of establishinga 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.
Parameters: name - is the name of the sequence. the next sequence number. exception: SQLException - if something goes wrong while fetching thenew value. |
sequence2 | public long sequence2(Statement s, String name, int pos) throws SQLException(Code) | | Obtains the sequence value for the current statement. Sigh.
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. exception: SQLException - if something goes wrong while fetching thenew 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)
|
|
|