Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Administration Guide

About JDBC Resources

ProcedureTo create a JDBC resource

A JDBC resource (data source) provides applications with a means of connecting to a database.

Before You Begin

Before creating a JDBC resource, first create a JDBC connection pool. See To create a JDBC connection pool.

  1. In the tree component, expand the Resources node.

  2. Under Resources, expand the JDBC node.

  3. Under JDBC, select the JDBC Resources node.

  4. On the JDBC Resources page, click New.

  5. On the Create JDBC Resource page, specify the resource’s settings:

    1. In the JNDI Name field, type a unique name.

      By convention, the name begins with the jdbc/ string. For example: jdbc/payrolldb. Don’t forget the forward slash.

    2. From the Pool Name combo box, choose the connection pool to be associated with the new JDBC resource.

    3. If you want the resource to be unavailable, deselect the Enabled checkbox.

      By default, the resource is available (enabled) as soon as it is created.

    4. In the Description field, type a short description of the resource.

    5. In the Targets section, specify the targets (clusters and standalone server instances) on which the resource is available.

      Select the desired target on the left, and click Add to add it to the list of selected targets.

  6. Click OK.

Equivalent asadmin command

create-jdbc-resource

ProcedureTo edit a JDBC resource

  1. In the tree component, expand the Resources node.

  2. Under Resources, expand the JDBC node.

  3. Under JDBC, expand the JDBC Resources node.

  4. Select the node for the JDBC resource to be edited.

  5. On the Edit JDBC Resource page, it is possible to perform these tasks:

    1. From the Pool Name combo box, select a different connection pool.

    2. In the Description field, change the short description of the resource.

    3. Select or deselect the checkbox to enable or disable the resource.

    4. Select the Targets tab to change the targets (clusters and standalone server instances) on which the resource is available.

      Select the checkbox for an existing target in the list, then click Enable to enable the resource for that target or Disable to disable the resource for that target.

      Click Manage Targets to add or remove targets to the list. In the Manage Targets page, select the desired target in the Available list on the left, and click Add to add it to the list of selected targets. Click Remove to remove a target from the Selected list.

      Click OK to save the changes to the available targets.

  6. Click Save to apply the edits.

ProcedureTo delete a JDBC resource

  1. In the tree component, expand the Resources node.

  2. Under Resources, expand the JDBC node.

  3. Under JDBC, select the Connection Pools node.

  4. On the Connection Pools page, select the checkbox for the pool to be deleted.

  5. Click Delete.

ProcedureTo enable or disable a JDBC resource

  1. In the tree component, expand the JDBC Resources node or expand the Standalone Instances to select the Server Instance node Resource tab.

  2. On the Resources page, select the checkbox for the resource to be enabled or disabled.

  3. Click Enable or Disable.