org.rimudb.pool
Class C3P0ConnectionManager

java.lang.Object
  extended by org.rimudb.pool.C3P0ConnectionManager
All Implemented Interfaces:
IConnectionManager

public class C3P0ConnectionManager
extends java.lang.Object
implements IConnectionManager

This class manages the C3P0 implementation of the connection pool.

Author:
Simon Ritchie

Constructor Summary
C3P0ConnectionManager(DatabaseConfiguration dbConfig)
           
 
Method Summary
 void connect(java.lang.String user, java.lang.String password)
          Connect to the database.
 void disconnect()
          Disconnect from the database.
 java.sql.Connection getDatabaseConnection()
          Get a database connection, presumably from a pool.
 PoolStatistic getPoolStatistic()
          Return a PoolStatistic describing the current status of the pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

C3P0ConnectionManager

public C3P0ConnectionManager(DatabaseConfiguration dbConfig)
Method Detail

connect

public void connect(java.lang.String user,
                    java.lang.String password)
             throws java.lang.Exception
Description copied from interface: IConnectionManager
Connect to the database.

Specified by:
connect in interface IConnectionManager
Parameters:
user - String
password - String
Throws:
java.lang.Exception

disconnect

public void disconnect()
                throws RimuDBException
Description copied from interface: IConnectionManager
Disconnect from the database.

Specified by:
disconnect in interface IConnectionManager
Throws:
RimuDBException

getDatabaseConnection

public java.sql.Connection getDatabaseConnection()
                                          throws java.sql.SQLException
Description copied from interface: IConnectionManager
Get a database connection, presumably from a pool.

Specified by:
getDatabaseConnection in interface IConnectionManager
Returns:
Connection
Throws:
java.sql.SQLException

getPoolStatistic

public PoolStatistic getPoolStatistic()
                               throws RimuDBException
Description copied from interface: IConnectionManager
Return a PoolStatistic describing the current status of the pool.

Specified by:
getPoolStatistic in interface IConnectionManager
Returns:
PoolStatistic
Throws:
RimuDBException


Copyright © 2008-2011 Simon Ritchie. All Rights Reserved.