Servertec Connection Pool Servlet
Content
Introduction
Release Notes
Features
FAQs
Requirements
Installation
Add-ons
How To
Change Log
Future Plans
Knowledge Base
Documentation
Samples
Hello World
Display Arguments
Display Headers
URL Redirect
CGI Tester
SSI Tester
Servlet Tag
Servlet Chaining
Log
Cookie Counter
Cookie Tester
Protected Page
List Employees
Connection Pool
Simple Form
Dump Form
Page Counter
File Upload
Session Tester
Context Tester
Legal
Contact Us

 

This example only works under Windows 9x/Me/NT/2000/2003/XP. The example makes use of the JDBC-ODBC bridge to access the employee table and may not work with JView.

Before this example can be used the following must be done:

  1. An entry must be defined as a System DSN using the ODBC Data Source Administrator from the Control Panel.
      Driver: Microsoft Access Driver (*mdb)
      Data Source Name: iob
      Database: iws_dir\databases\iob.mdb
    where:
    iws_dir is the directory where the server was installed, normally c:\iws.

  2. The following Connection Pool entry must be defined in the Administrator - Connection Pools.
      Connection Pool: iob
      Driver: sun.jdbc.odbc.JdbcOdbcDriver
      URL: jdbc:odbc:iob
      Username:
      Password:
      Initial Size: 10
      Maximum Size: 20

  3. Restart the server.

This example displays a table showing any existing rows in the employee table.

The example makes use of iob, a pool of connections that was created when the server was first started. Each time service() is called an attempt is made to acquire a connection from the pool. If a connection is available the servlet is able to process the client's request. When the servlet closed the connection or when the servlets exits, the connection is returned to the pool for later reuse. If no more connections are available in the pool then an exception is thrown and an error message is sent back to the user. All connections in the pool are finally closed when the server is stopped.

Connection pools are an efficient way of managing a limited resource.

[ view source ] [ run ]

 top of page
Copyright © 1998-2005 Servertec. All rights reserved.
Privacy Statement.
Last Modified: Sun Sep 04 14:56:51 EDT 2005