J2EE Compliance: Java Transaction API and javax.sql Extensions
Page 4 of 4

javax.sql: JDBC Extensions

This section documents the JDBC extensions that Cloudscape implements for J2EE compliance. (For more details about these extensions, see http://java.sun.com/products/jdbc/jdbc20.stdext.javadoc/javax/sql/package-summary.html).

  • javax.sql.DataSource

    Cloudscape's implementation of DataSource means that it supports JNDI; as a resource manager, it allows a database to be named and registered within a JNDI server. This allows the calling application to access the database by a name (as a data source) instead of through a database connection URL.

NOTE: Support for remote (client/server) data sources is provided through RmiJdbc. (XADataSources are local only.)

  • javax.sql.ConnectionPoolDataSource

    Support of this interface allows a connection pool server to maintain a set of connections to the resource manager (Cloudscape). Such a connection pool is useful in client/server environments because establishing a connection is relatively expensive. In an embedded environment, connections are much cheaper.

  • javax.sql.PooledConnection

    Support of this interface allows a connection pool server to maintain a set of connections to the resource manager (Cloudscape). Such a connection pool is useful in client/server environments because establishing a connection is relatively expensive. In an embedded environment, connections are much cheaper.

  • javax.sql.XAConnection

    An XAConnection produces an XAResource, and, over its lifetime, many Connections. It allows for distributed transactions.

  • javax.sql.XADataSource

    An XADataSource is simply a ConnectionPoolDataSource that produces XAConnections.

In addition, Cloudscape provides three methods for XADataSource, DataSource, and ConnectionPoolDataSource that are not part of the standard API:

  • setCreateDatabase(String create)

    Sets a property to create a database at the next connection. The string argument must be "create".

  • setShutdownDatabase(String shutdown)

    Sets a property to shut down a database. Shuts down the database at the next connection. The string argument must be "shutdown".

  • setRemoteDataSourceProtocol(String rmi)

    Sets a property to enable the correct protocol for working with data sources in a client/server environment using RmiJdbc. The string must be "rmi". Not valid for XADataSources.

NOTE: Set these properties before getting the connection.