|
OpMath | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
The interface that must be implemented for any JDBC driver that can support OpMath Data Platform operations.
Classes implementing DB are assumed to be in-process or embedded drivers.
Copyright: (c) 2002 The Open Math Company Limited
The Terms of Distribution of this software are stipulated in the javadoc Overview for this project.
| Method Summary | |
String |
className()
Returns the name of the class of this DBObject object. |
void |
close()
Shut down the database server or driver. |
void |
connect(String user,
String pass)
Establish a connection to the database. |
void |
create(String table,
String values)
Creates a new row in the named table. |
void |
createTable(String table,
String sql)
Creates a new table within this database. |
void |
delete(String table,
String keyName,
long keyValue)
Deletes the row (or rows) with the specfied key name and value, in the named table. |
void |
delete(String table,
String keyName,
String keyValue)
Deletes the row (or rows) with the specfied key name and value, in the named table. |
void |
dropTable(String table)
Deletes a table within this database. |
Connection |
getConnection()
Returns the connection object for this DB instance. |
Class |
getDriver()
Returns the driver class of this DB. |
String |
getPath()
Returns the fully qualified path for the current connection. |
String |
getProtocol()
Returns the protocol for the current connection. |
boolean |
isAvailable()
Tests whether the database is responding. |
String |
maxIndex(String table,
String pkName)
Returns the highest value of the primary key for the named table. |
ResultSet |
query(String table,
String where,
String order)
Returns the rows from the named table, as found by the ad hoc query given in sql. |
ResultSet |
read(String table,
String keyName,
long keyValue)
Returns the rows from the named table whose field keyName
exactly matches keyValue. |
ResultSet |
read(String table,
String keyName,
String keyValue)
Returns the rows from the named table whose field keyName
exactly matches keyValue. |
ResultSet |
readAll(String table,
String order)
Returns all of the rows from the named table. |
void |
update(String table,
String pkName,
long pkValue,
String set)
Updates the row with the specfied primary key name and value, in the named table. |
void |
update(String table,
String pkName,
String pkValue,
String set)
Updates the row with the specfied primary key name and value, in the named table. |
| Method Detail |
public void connect(String user,
String pass)
throws SQLException
Establish a connection to the database. By default, autoCommit
will be set to true.
NOTE: It is assumed that only one simultaneous connection can be held by
any DB instance.
SQLException - if the connection could not be made.
SQLExceptionConnection.setAutoCommit(boolean)
public void close()
throws SQLException
Shut down the database server or driver.
SQLException - if the database could not be shut down.
SQLExceptionpublic boolean isAvailable()
Tests whether the database is responding.
boolean indicating database availability.
public Class getDriver()
throws ClassNotFoundException
Returns the driver class of this DB.
Class representing the database driver.
ClassNotFoundException - if the driver class cannot be found.
ClassNotFoundExceptionpublic String getProtocol()
Returns the protocol for the current connection.
Returns null if there is no current connection.
Class representing the database driver.public String getPath()
Returns the fully qualified path for the current connection.
Returns null if there is no current connection.
Class representing the database driver.
public Connection getConnection()
throws SQLException
Returns the connection object for this DB instance.
Connection object.
SQLException - if the connection could not be made.
SQLExceptionpublic String className()
Returns the name of the class of this DBObject object.
String naming the class.
public void createTable(String table,
String sql)
throws SQLException
Creates a new table within this database.
SQLException - if the table could not be created.
SQLException
public void dropTable(String table)
throws SQLException
Deletes a table within this database.
SQLException - if the table could not be deleted.
SQLException
public String maxIndex(String table,
String pkName)
throws SQLException
Returns the highest value of the primary key for the named table. The value
is returned as a String, irrespective of its actual stored type.
SQLException - if the operation could not be completed.
SQLException
public void create(String table,
String values)
throws SQLException
Creates a new row in the named table.
The String values is used within the VALUES(..)
SQL sub-clause of the INSERT statement, and is a comma-separated list of values
that must be appropriate to the table definition.
SQLException - if the create operation could not be completed.
SQLException
public ResultSet read(String table,
String keyName,
long keyValue)
throws SQLException
Returns the rows from the named table whose field keyName
exactly matches keyValue.
ResultSet carrying the retrieved data.
SQLException - if the read operation could not be completed.
SQLException
public ResultSet read(String table,
String keyName,
String keyValue)
throws SQLException
Returns the rows from the named table whose field keyName
exactly matches keyValue.
ResultSet carrying the retrieved data.
SQLException - if the read operation could not be completed.
SQLException
public ResultSet readAll(String table,
String order)
throws SQLException
Returns all of the rows from the named table.
The String order is a comma-seperated list of field names
(most significant field first), each with sort direction.
ResultSet carrying the retrieved data.
SQLException - if the read operation could not be completed.
SQLException
public ResultSet query(String table,
String where,
String order)
throws SQLException
Returns the rows from the named table, as found by the ad hoc query given in
sql. The String where is used within the WHERE
SQL sub-clause of the SELECT statement.
The String order is a comma-seperated list of field names
(most significant field first), each with sort direction.
ResultSet carrying the retrieved data.
SQLException - if the query operation could not be completed.
SQLException
public void update(String table,
String pkName,
long pkValue,
String set)
throws SQLException
Updates the row with the specfied primary key name and value, in the named
table. The String where is used within the SET
SQL sub-clause of the UPDATE statement.
SQLException - if the update operation could not be completed.
SQLException
public void update(String table,
String pkName,
String pkValue,
String set)
throws SQLException
Updates the row with the specfied primary key name and value, in the named
table. The String where is used within the SET
SQL sub-clause of the UPDATE statement.
SQLException - if the update operation could not be completed.
SQLException
public void delete(String table,
String keyName,
long keyValue)
throws SQLException
Deletes the row (or rows) with the specfied key name and value, in the named table.
SQLException - if the delete operation could not be completed.
SQLException
public void delete(String table,
String keyName,
String keyValue)
throws SQLException
Deletes the row (or rows) with the specfied key name and value, in the named table.
SQLException - if the delete operation could not be completed.
SQLException
|
OpMath | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||