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 DB2 database connections from a Web server.

Run the connection pool sample

Reminder: Before you can run this sample, you must do additional configuration for the DB2 database and WebSphere Application Server.


How this sample works:

The Connection Pool sample has:

  • A Java servlet that accesses a table in the DB2 SAMPLE database and returns all rows that match a given value (in this case, everyone whose last name is PARKER).

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 Connection pooling documentation in the WebSphere Application Server documentation center for complete details.