Setting up a JDBC Resource on the Sun Java System Application Server

See Also

A JDBC resource (data source) provides applications with a means of connecting to a database through a connection pool. Typically, there is at least one JDBC resource for each database accessed by an application deployed in a domain. It is possible to have more than one JDBC resource for a database.

When you generate CMP entity beans from a database or use the Enterprise Resources > Use Database command to generate lookup code for a database, the JDBC data sources are generated automatically.

To create a JDBC resource:

  1. Ensure the Sun Java System Application Server is running.
  2. Go to File > New (Ctrl-N).
  3. In the Project drop-down list, choose either your EJB module or Web module.
  4. Select Sun Resources in the Categories pane, JDBC Resource in the File Types pane, and click Next.
  5. Select an existing connection pool or create a new one.
  6. (required) Enter a JNDI name for the resource.
  7. Enable or disable the resource by choosing True or False.
  8. Enter a description and click Next.
  9. Enter any properties for the resource.
  10. Click Finish.

To prepare to use a data source on the Sun Java System Application Server:

  1. Ensure the Sun Java System Application Server is running.
  2. Register the resource with the server by right-clicking the resource in the Projects or Files windows and choosing Register.

    The resource is automatically registered when the project is deployed. When you register the resource, the resource is available to all applications and resources.

  3. Create a web application and select the Sun Java System Application Server as the target server.
  4. Access the data source in, for example, a JSP page.
See Also
Registering a Resource with the Sun Java System Application Server
Connecting to a Database
About Connection Pools

Legal Notices