Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Developer's Guide

- Previous: Part II Developing Applications and Application Components
- Next: Creating Applications That Use the JDBC API

# General Steps for Creating a JDBC Resource

To prepare a JDBC resource for use in J2EE applications deployed to the Application Server, perform the following tasks:

- Integrating the JDBC Driver

- Creating a Connection Pool

- Testing a Connection Pool

- Creating a JDBC Resource

For information about how to configure some specific JDBC drivers, see the Configurations for Specific JDBC Drivers.

## Integrating the JDBC Driver

To use JDBC features, you must choose a JDBC driver to work with the Application Server, then you must set up the driver. This section covers these topics:

- Supported Database Drivers

- Making the JDBC Driver JAR Files Accessible

### Supported Database Drivers

Supported JDBC drivers are those that have been fully tested by Sun. For a list of the JDBC drivers currently supported by the Application Server, see the Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Release Notes. For configurations of supported and other drivers, see Configurations for Specific JDBC Drivers.

Note –

Because the drivers and databases supported by the Application Server are constantly being updated, and because database vendors continue to upgrade their products, always check with Sun technical support for the latest database support information.

### Making the JDBC Driver JAR Files Accessible

To integrate the JDBC driver into a Application Server domain, copy the JAR files into the domain-dir`/lib/ext` directory, then restart the server. This makes classes accessible to any application or module across the domain. For more information about Application Server classloaders, see Classloaders.

## Creating a Connection Pool

When you create a connection pool that uses JDBC technology (a JDBC connection pool) in the Application Server, you can define many of the characteristics of your database connections.

You can create a JDBC connection pool in one of these ways:

- In the Administration Console, open the Resources component, open the JDBC component, and select Connection Pools. For details, see the Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Administration Guide.

- Use the `asadmin create-jdbc-connection-pool` command. For details, see the Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Reference Manual.

## Testing a Connection Pool

You can test a JDBC connection pool for usability in one of these ways:

- In the Administration Console, open the Resources component, open the JDBC component, select Connection Pools, and select the connection pool you want to test. Then select the Ping button in the top right corner of the page. For details, see the Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Administration Guide.

- Use the `asadmin ping-connection-pool` command. For details, see the Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Reference Manual

Both these commands fail and display an error message unless they successfully connect to the connection pool.

For information about how to tune a connection pool, see the Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Performance Tuning Guide.

## Creating a JDBC Resource

A JDBC resource, also called a data source, lets you make connections to a database using `getConnection()`. Create a JDBC resource in one of these ways:

- In the Administration Console, open the Resources component, open the JDBC component, and select JDBC Resources. For details, see the Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Administration Guide.

- Use the `asadmin create-jdbc-resource` command. For details, see the Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Reference Manual.

- Previous: Part II Developing Applications and Application Components
- Next: Creating Applications That Use the JDBC API

- © 2010, Oracle Corporation and/or its affiliates