OpMath

com.opmath.util.db.cloudscape36
Class Cloudscape36

java.lang.Object
  |
  +--com.opmath.util.db.DBObject
        |
        +--com.opmath.util.db.cloudscape36.Cloudscape36
All Implemented Interfaces:
DB

public final class Cloudscape36
extends DBObject
implements DB

A class providing an adapter for the IBM Cloudscape version 3.6 embedded database driver, implementing the com.opmath.util.db.DB interface.

Refer to the Clouscape documentation for information on the use of the the driver, at http://www.cloudscape.com/docs/doc_36/doc/html/coredocs/docs.htm.

Copyright: (c) 2002 The Open Math Company Limited

The Terms of Distribution of this software are stipulated in the javadoc Overview for this project.

Since:
J2SE 1.3.0
Version:
DB v1.0
Author:
Bruno Beloff bruno.beloff@opmath.com

Field Summary
static String JDBC_DRIVER
           
static String JDBC_PROTOCOL
           
 
Fields inherited from class com.opmath.util.db.DBObject
conn, path, protocol
 
Constructor Summary
Cloudscape36(String path)
          Constructs a new Cloudscape36 object.
 
Method Summary
 void close()
          Close the connection.
 void connect(String user, String pass)
          Establish a connection to a Cloudscape embedded database.
 Class getDriver()
          Returns the driver class of this DB.
 
Methods inherited from class com.opmath.util.db.DBObject
className, create, createTable, delete, delete, dropTable, getConnection, getPath, getProtocol, isAvailable, maxIndex, newDbConnection, query, read, read, readAll, update, update
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
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

JDBC_PROTOCOL

public static final String JDBC_PROTOCOL

JDBC_DRIVER

public static final String JDBC_DRIVER
Constructor Detail

Cloudscape36

public Cloudscape36(String path)

Constructs a new Cloudscape36 object.

The new Cloudscape36 object has protocol and path set appropriately, and its connection is initially closed.

Parameters:
path - a String identifying the absolute path to the database directory.
Since:
J2SE 1.3
Method Detail

getDriver

public Class getDriver()
                throws ClassNotFoundException

Returns the driver class of this DB.

Specified by:
getDriver in interface DB
Overrides:
getDriver in class DBObject
Returns:
A Class representing the database driver.
Throws:
ClassNotFoundException - if the driver class cannot be found.
Since:
J2SE 1.3

connect

public void connect(String user,
                    String pass)
             throws SQLException

Establish a connection to a Cloudscape embedded database. The connection is configured with autocommit true and the transaction isolation level set to java.sql.Connection.TRANSACTION_SERIALIZABLE.

NOTE: It is assumed that only one symultaneous connection can be held by any DB instance.

Specified by:
connect in interface DB
Overrides:
connect in class DBObject
Parameters:
user - a String specifying the user name.
pass - a String specifying the password.
Throws:
SQLException - if the connection could not be made.
Since:
J2SE 1.3
See Also:
Connection.setAutoCommit(boolean)

close

public void close()
           throws SQLException

Close the connection.

Specified by:
close in interface DB
Overrides:
close in class DBObject
Throws:
SQLException - if the connection could not be closed, or was already closed.
Since:
J2SE 1.3

OpMath

Submit a bug or feature to Open Math
Copyright © 2002 Open Math Company Limited, Brighton, UK