org.aris.hldb.pools
Class ConnectionPoolProvider

java.lang.Object
  extended by org.aris.hldb.pools.ConnectionPoolProvider
All Implemented Interfaces:
ConnectionProviderI

public class ConnectionPoolProvider
extends java.lang.Object
implements ConnectionProviderI

A simple connection pool provider. Reuses a maximum of n number of connections.

Version:
1.0
Author:
Konstantine Kougios

Constructor Summary
ConnectionPoolProvider(java.lang.String db_name, int max_Connections)
          Creates a new instance of hlCon pool.
 
Method Summary
 java.sql.Connection allocConnection()
          Returns a connection object by this pool.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionPoolProvider

public ConnectionPoolProvider(java.lang.String db_name,
                              int max_Connections)
Creates a new instance of hlCon pool. Usage example:
hlCon hlc=new hlCon("jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=test;SelectMethod=cursor;User=sa;Password=mypass",10);

Parameters:
db_name - the connection string for this connection.
max_Connections - Maximum connection objects that will be created by this pool.
Method Detail

allocConnection

public java.sql.Connection allocConnection()
                                    throws java.sql.SQLException
Returns a connection object by this pool. If there is no available connection and the pool is not full yet, it will create a new Connection. If the pool is full then it will reuse it's connection objects.

Specified by:
allocConnection in interface ConnectionProviderI
Returns:
A Connection object.
Throws:
java.sql.SQLException - -