javax.sql: JDBC Extensions javax.sql packageJDBC 2.0standard extensions javax.sql.PooledConnectionConnection pooling javax.sql.DataSourceData sources javax.sql.XAConnectionjavax.sql.XADataSource Data sourcescreating a database for Data sourcesshutting down a database for

This section documents the JDBC extensions that implements for J2EE compliance. (For more details about these extensions, see the API documentation for your version of the Java Development Kit, which you can find at http://java.sun.com/javase/reference/api.jsp).

  • javax.sql.DataSource

    '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.

  • javax.sql.ConnectionPoolDataSource and javax.sql.PooledConnection

    Establishing a connection to the database can be a relatively expensive operation in client/server environments. Establishing the connection once and then using the same connection for multiple requests can dramatically improve the performance of a database.

    The implementation of ConnectionPoolDataSource and PooledConnection allows a connection pool server to maintain a set of such connections to the resource manager (). In an embedded environment, connections are much cheaper and connection pooling is not necessary.

  • 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, provides three methods for XADataSource, DataSource, and ConnectionPoolDataSource. supports a number of additional data source properties:

  • 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".

Set these properties before getting the connection.