The example makes use of the JDBC-ODBC bridge to access the employee table.
Before this example can be used the following must be done:
- 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.net.
- The following Connection Pool entry must be defined in the
Administrator - Connection Pools.
Connection Pool: iob
Driver: com.ms.jdbc.odbc.JdbcOdbcDriver
URL: jdbc:odbc:iob
Username:
Password:
Initial Size: 10
Maximum Size: 20
- 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 ]
|