org.apache.commons.dbcp
Class DataSourceConnectionFactory

java.lang.Object
  extended byorg.apache.commons.dbcp.DataSourceConnectionFactory
All Implemented Interfaces:
ConnectionFactory

public class DataSourceConnectionFactory
extends Object
implements ConnectionFactory

A DataSource-based implementation of ConnectionFactory.

Version:
$Revision: 892307 $ $Date: 2014-01-01 00:27:28 +0100 (Wed, 01 Jan 2014) $
Author:
Rodney Waldhoff

Field Summary
protected  String _passwd
           
protected  DataSource _source
           
protected  String _uname
           
 
Constructor Summary
DataSourceConnectionFactory(DataSource source)
           
DataSourceConnectionFactory(DataSource source, String uname, String passwd)
           
 
Method Summary
 Connection createConnection()
          Create a new Connection in an implementation specific fashion.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_uname

protected String _uname

_passwd

protected String _passwd

_source

protected DataSource _source
Constructor Detail

DataSourceConnectionFactory

public DataSourceConnectionFactory(DataSource source)

DataSourceConnectionFactory

public DataSourceConnectionFactory(DataSource source,
                                   String uname,
                                   String passwd)
Method Detail

createConnection

public Connection createConnection()
                            throws SQLException
Description copied from interface: ConnectionFactory
Create a new Connection in an implementation specific fashion.

Specified by:
createConnection in interface ConnectionFactory
Returns:
a new Connection
Throws:
SQLException - if a database error occurs creating the connection


Copyright © The Apache Software Foundation. All Rights Reserved.