Package org.apache.commons.dbcp
Class DriverManagerConnectionFactory
java.lang.Object
org.apache.commons.dbcp.DriverManagerConnectionFactory
- All Implemented Interfaces:
ConnectionFactory
A
DriverManager
-based implementation of ConnectionFactory
.- Version:
- $Revision: 746827 $ $Date: 2009-02-22 16:41:52 -0500 (Sun, 22 Feb 2009) $
- Author:
- Rodney Waldhoff, Ignacio J. Ortega, Dirk Verbeeck
-
Constructor Summary
ConstructorsConstructorDescriptionDriverManagerConnectionFactory
(String connectUri, String uname, String passwd) Constructor for DriverManagerConnectionFactory.DriverManagerConnectionFactory
(String connectUri, Properties props) Constructor for DriverManagerConnectionFactory. -
Method Summary
-
Constructor Details
-
DriverManagerConnectionFactory
Constructor for DriverManagerConnectionFactory.- Parameters:
connectUri
- a database url of the formjdbc:subprotocol:subname
props
- a list of arbitrary string tag/value pairs as connection arguments; normally at least a "user" and "password" property should be included.
-
DriverManagerConnectionFactory
Constructor for DriverManagerConnectionFactory.- Parameters:
connectUri
- a database url of the formjdbc:subprotocol:subname
uname
- the database userpasswd
- the user's password
-
-
Method Details
-
createConnection
Description copied from interface:ConnectionFactory
Create a newConnection
in an implementation specific fashion.- Specified by:
createConnection
in interfaceConnectionFactory
- Returns:
- a new
Connection
- Throws:
SQLException
- if a database error occurs creating the connection
-