Servertec   Connection Pool
Content
Introduction
Release Notes
Features
FAQs
Requirements
Installation
Change Log
Future Plans
Knowledge Base
Documentation
Samples
hello
args
headers
redirect
include
log
cookiecounter
protected
listemployees
connectionpool
simpleform
dumpform
pagecounter
Sales
Legal
Feedback

 

This example only works under Windows NT/9x when the Microsoft Adventure Works, a Microsoft Access example, is already installed. The example makes use of the JDBC-ODBC bridge to access the employee table and may not work with JView.

Before using this example the following entries must be defined:

  • AdvWorks must also be defined as a System DNS in the ODBC Control Panel.
  • the connection pool below must be added to Connection Pools using iServer Administrator.

    ID: advworks
    Driver: sun.jdbc.odbc.JdbcOdbcDriver
    URL: url=jdbc:odbc:AdvWorks
    Initial Size: 10
    Maximum Size: 20

This example displays a table showing any existing rows in the employee table. The first column contains the employee's first name and the second column contains the employee's last name.

The example makes use of 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.

Microsoft Adventure Works and Microsoft Access are copyright of Microsoft Corporation. Microsoft is a registered to Microsoft Corporation.

[ view source ] [ run ]

 top of page
 Built with iScript Copyright © 1997-1999 Servertec. All rights reserved.
Last Modified: Tue Jan 26 22:59:17 EST 1999