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.
- A JDBC resource connects to a JDBC connection pool. If you have not already
created the JDBC connection pool, you can create it in the wizard while you are creating the
resource.
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:
- Ensure the Sun Java System Application Server is running.
- Go to File > New (Ctrl-N).
- In the Project drop-down list, choose either your EJB module or Web module.
- Select Sun Resources in the Categories pane, JDBC Resource in the File Types pane, and click Next.
- Select an existing connection pool or create a new one.
- (required) Enter a JNDI name for the resource.
- Enable or disable the resource by choosing True or False.
- Enter a description and click Next.
- Enter any properties for the resource.
- Click Finish.
To prepare to use a data source on the Sun Java System Application Server:
- Ensure the Sun Java System Application Server is running.
- 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.
- Create a web application and select the Sun Java System Application Server as the target server.
- 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