Accessing a Connection Pool from a JSP Page

See Also

There are many ways of using a JDBC resource (also known as a data source) in an application. The simplest way is to access your JDBC resource directly from a JSP file using the JSTL 1.1 tag library. You are recommended to use this method for testing purposes and in small web applications only.

To set up a JSP file to use the JSTL 1.1 tag library to access a data source:

  1. Set up a Sun Java System Application Server connection pool, a JBoss Application Server connection pool, or a Tomcat connection pool.
  2. Right-click the web application project's Libraries node, click Add Library, and choose JSTL 1.1.
  3. Expand the project node and the Web Pages node and double-click the default index.jsp node. (Instead of using the default index.jsp file, you can create your own JSP file.) The JSP file opens in the Source Editor. Now modify the JSP file to do the following:

  4. Make the database driver available to your server. For example, for the Tomcat Web Server, copy the database driver's JAR file into the Tomcat Web Server's common/lib folder, within the IDE's installation folder. For the JBoss Application Server, move the driver JAR file to the domain's lib directory. So, for PointBase, copy pbclient.jar (or pbembedded.jar) to the Tomcat Web Server's common/lib folder. For the JBoss Application Server, copy pbclient.jar (or pbembedded.jar) to the server/default/lib folder, if you are using the default domain.
    tip  If you have already started the server, make sure that you restart it after you copy the database driver's JAR file, so that the server can load the JAR file.
  5. Start the database server.
  6. Run the JSP file or the application that contains it.
See Also
About the Sun Java System Application Server
About the JBoss Application Server
About the Tomcat Web Server

Legal Notices