org.apache.log4j.jdbcplus.examples
Class DbcpPoolConnectionHandler

java.lang.Object
  |
  +--org.apache.log4j.jdbcplus.examples.DbcpPoolConnectionHandler
All Implemented Interfaces:
JDBCConnectionHandler, JDBCPoolConnectionHandler

public class DbcpPoolConnectionHandler
extends Object
implements JDBCPoolConnectionHandler

Implement a sample JDBCConnectionHandler using a Jakarta commons-dbcp connection pool

Since:
2.0
Version:
see jdbcappender.jar/META-INF/MANIFEST.MF for version information
Author:
Danko Mannhaupt

Constructor Summary
DbcpPoolConnectionHandler()
           
 
Method Summary
 void freeConnection(Connection con)
          The connection is free again, and can be used elsewhere
 Connection getConnection()
          Get a connection
 Connection getConnection(String _url, String _username, String _password)
          Get a defined connection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbcpPoolConnectionHandler

public DbcpPoolConnectionHandler()
Method Detail

getConnection

public Connection getConnection()
Description copied from interface: JDBCConnectionHandler
Get a connection

Specified by:
getConnection in interface JDBCConnectionHandler
Returns:
The Connection value

getConnection

public Connection getConnection(String _url,
                                String _username,
                                String _password)
Description copied from interface: JDBCConnectionHandler
Get a defined connection

Specified by:
getConnection in interface JDBCConnectionHandler
Parameters:
_url - Description of Parameter
_username - Description of Parameter
_password - Description of Parameter
Returns:
The Connection value

freeConnection

public void freeConnection(Connection con)
                    throws Exception
The connection is free again, and can be used elsewhere

Specified by:
freeConnection in interface JDBCPoolConnectionHandler
Parameters:
con - connection to be freed
Throws:
Exception - if any error occurs


Copyright 2000-2004 Apache Software Foundation.