org.rimudb.pool
Class JNDIConnectionManager

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

public class JNDIConnectionManager
extends java.lang.Object
implements IConnectionManager

This class manages the JNDI implementation of a connection pool. A container like Spring or an Application Server can manage connection pools that are made available via JNDI.

Author:
Simon Ritchie

Constructor Summary
JNDIConnectionManager(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.
protected  javax.sql.DataSource getDataSource()
           
 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

JNDIConnectionManager

public JNDIConnectionManager(DatabaseConfiguration dbConfig)
Method Detail

getDataSource

protected javax.sql.DataSource getDataSource()
                                      throws java.sql.SQLException
Throws:
java.sql.SQLException

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.