al connection stuff } finally { conn.close(); }
Configuration
<database name='jdbc/test'> <init> <driver>postgresql.Driver</driver> <url>jdbc:postgresql://localhost/test</url> <user>ferg</user> <password>foobar</password> </init> </database>
Pool limits and timeouts
The pool will only allow getMaxConnections() connections alive at a time. If
getMaxConnection
connections are already active,
getPooledConnection
will block waiting for an available connection. The wait is timed. If connection-wait-time passes and there is still no connection,
getPooledConnection
create a new connection anyway.
Connections will only stay in the pool for about 5 seconds. After that they will be removed and closed. This reduces the load on the DB and also protects against the database dropping old connections.