|
OpMath | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.opmath.util.db.DBObject
|
+--com.opmath.util.db.DBRemoteObject
|
+--com.opmath.util.db.mysql40.MySQLRemote
An adapter for the MySQL database version 4.0 Server, implementing the
org.opmath.util.db.DBRemote interface.
Note that the following MySQL JAR files are required in order that the host application server can connect to the JDataStore server:
mysql-connector-java-3.0.9-stable-bin.jar
Refer to the MySQL documentation for information on the use of the MySQL server, at: http://www.mysql.com/products/index.html
RUNTIME: The http://www.mysql.com/products/index.html server must be running on an
accessible host in order for this class to operate correctly. See the
mysql/bin/mysqld and mysql/bin/safe_mysqldcommands.
Copyright Copyright (c) 2001, 2002, 2003 The Open Math Company Limited
The Terms of Distribution of this software are stipulated in the javadoc Overview for this project.
| Field Summary | |
static String |
JDBC_DRIVER
|
static String |
JDBC_PROTOCOL
|
| Fields inherited from class com.opmath.util.db.DBRemoteObject |
host |
| Fields inherited from class com.opmath.util.db.DBObject |
conn, path, protocol |
| Constructor Summary | |
MySQLRemote(String host,
String path)
Constructs a new MySQLRemote object. |
|
| Method Summary | |
void |
close()
Close the connection. |
void |
connect(String user,
String pass)
Establish a connection to a MySQL server. |
Class |
getDriver()
Returns the driver class of this DB. |
| Methods inherited from class com.opmath.util.db.DBRemoteObject |
getHost, newDbConnection, newDbConnection |
| Methods inherited from class com.opmath.util.db.DBObject |
className, create, createTable, delete, delete, dropTable, getConnection, getPath, getProtocol, isAvailable, maxIndex, query, read, read, readAll, update, update |
| Methods inherited from class java.lang.Object |
|
| Methods inherited from interface com.opmath.util.db.DBRemote |
getHost |
| Methods inherited from interface com.opmath.util.db.DB |
className, create, createTable, delete, delete, dropTable, getConnection, getPath, getProtocol, isAvailable, maxIndex, query, read, read, readAll, update, update |
| Field Detail |
public static final String JDBC_PROTOCOL
public static final String JDBC_DRIVER
| Constructor Detail |
public MySQLRemote(String host,
String path)
Constructs a new MySQLRemote object.
The new MySQLRemote object has protocol, host, and
path set appropriately, and its connection is initially closed.
host - a String identifying the database
host name.path - a String identifying the absolute
path to the .jds database file.| Method Detail |
public Class getDriver()
throws ClassNotFoundException
Returns the driver class of this DB.
getDriver in interface DBgetDriver in class DBObjectClass representing the database driver.ClassNotFoundException - if the driver class cannot be found.
public void connect(String user,
String pass)
throws SQLException
Establish a connection to a MySQL server.
The connection is configured with autocommit false and the transaction
isolation level set to java.sql.Connection.TRANSACTION_SERIALIZABLE.
NOTE: It is assumed that only one simultaneous connection can be held by
any DB instance. Thus, connect(String, String)
throws a SQLException if a connection is already established.
connect in interface DBconnect in class DBObjectuser - a String specifying the user name.pass - a String specifying the password.SQLException - if the connection could not be made.
public void close()
throws SQLException
Close the connection.
close in interface DBclose in class DBObjectSQLException - if the connection could not be closed,
or was already closed.
|
OpMath | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||