Sun GlassFish Enterprise Server v3 Prelude Administration Guide

ProcedureTo Create a JDBC Resource

The remote create-jdbc-resource command enables you to create a JDBC resource. Creating a JDBC resource is a dynamic event and does not require server restart.

Because all JNDI names are in the java:comp/env subcontext, when specifying the JNDI name of a JDBC resource in the Administration Console, use only the jdbc/name format is used. For example, a payroll database might be specified as jdbc/payrolldb.

Before You Begin

Before creating a JDBC resource, you must first create a JDBC connection pool. For instructions, see To Create a JDBC Connection Pool.

  1. Ensure that the server is running.

    Remote commands require a running server.

  2. Create a JDBC resource by using the create-jdbc-resource(1) command.

  3. If necessary, notify users that the new resource has been created.

Example 5–7 Creating a JDBC Resource

The following example command creates a JDBC resource named DerbyPool:

asadmin create-jdbc-resource --connectionpoolid DerbyPool jdbc/DerbyPool

Information similar to the following is displayed if the connection pool is usable:

Command create-jdbc-resource executed successfully.

See Also

To see the full syntax and options of the command, type asadmin create-jdbc-resource --help at the command line.