Package org.apache.commons.dbcp2
Class DriverManagerConnectionFactory
java.lang.Object
org.apache.commons.dbcp2.DriverManagerConnectionFactory
- All Implemented Interfaces:
ConnectionFactory
A
DriverManager
-based implementation of ConnectionFactory
.- Since:
- 2.0
- Version:
- $Id: DriverManagerConnectionFactory.java 1649430 2015-01-04 21:29:32Z tn $
- 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
-