velosurf.sql
Class ConnectionPool

java.lang.Object
  extended by velosurf.sql.ConnectionPool

public class ConnectionPool
extends java.lang.Object

Connection pool.

Author:
Claude Brisson

Field Summary
private  boolean autocommit
          autocommit flag
private  java.util.List<ConnectionWrapper> connections
          list of all connections
private  DriverInfo driver
          infos on the driver
private  int max
          Maximum number of connections.
private  int min
          Minimum number of connections.
private  java.lang.String password
          password
private  java.lang.String schema
          optional schema
private  java.lang.String url
          database url
private  java.lang.String user
          user
 
Constructor Summary
ConnectionPool(java.lang.String url, java.lang.String user, java.lang.String password, java.lang.String schema, DriverInfo driver, boolean autocommit, int min, int max)
          Constructor.
 
Method Summary
 void clear()
          clear all connections.
private  ConnectionWrapper createConnection()
          Create a connection.
 ConnectionWrapper getConnection()
          Get a connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

user

private java.lang.String user
user


password

private java.lang.String password
password


url

private java.lang.String url
database url


schema

private java.lang.String schema
optional schema


driver

private DriverInfo driver
infos on the driver


autocommit

private boolean autocommit
autocommit flag


connections

private java.util.List<ConnectionWrapper> connections
list of all connections


min

private int min
Minimum number of connections.


max

private int max
Maximum number of connections.

Constructor Detail

ConnectionPool

public ConnectionPool(java.lang.String url,
                      java.lang.String user,
                      java.lang.String password,
                      java.lang.String schema,
                      DriverInfo driver,
                      boolean autocommit,
                      int min,
                      int max)
               throws java.sql.SQLException
Constructor.

Parameters:
url - url
user - user
password - password
schema - schema
driver - infos on the driver
autocommit - autocommit
min - min connections
max - max connections
Throws:
java.sql.SQLException
Method Detail

getConnection

public ConnectionWrapper getConnection()
                                throws java.sql.SQLException
Get a connection.

Returns:
a connection
Throws:
java.sql.SQLException

createConnection

private ConnectionWrapper createConnection()
                                    throws java.sql.SQLException
Create a connection.

Returns:
connection
Throws:
java.sql.SQLException

clear

public void clear()
clear all connections.



~ooOoo~