Connection Pool Sample

The Connection Pool sample shows you how to use a DataSource object to access relational data using the JDBC 2.0 APIs.

The DataSource objects have built-in connection pooling that makes efficient use of database connections from a Web server.

This sample requires a database to store employee information. If you have not already installed and configured your database for the WebSphere samples, refer to Database Configuration for instructions. The configuration includes creating the jdbc/sample DataSource object.

Run the connection pool sample

 


How this sample works:

The Connection Pool sample has:

  • A Java servlet that accesses a table in the SAMPLE database and returns all rows that match a given value (in this case, everyone whose last name is PARKER, SMITH, or KWAN, depending on your selection).

This servlet uses the JDBC 2.0 Core classes, standard extension classes, and JNDI naming classes.

 


How to use this sample:

Using DataSource objects to get database connections from a centrally manned pool reduces the resources used by your servlets. To use this technique in your servlets, read the comments and follow the steps described in the ConnPoolTest servlet.

 

For more information:
Refer to the WebSphere Application Server's documentation for more information on connection pooling..