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:subnameprops- a list of arbitrary string tag/value pairs as connection arguments; normally at least a "user" and "password" property should be included.
-
DriverManagerConnectionFactory
-
-
Method Details
-
createConnection
Description copied from interface:ConnectionFactoryCreate a newConnectionin an implementation specific fashion.- Specified by:
createConnectionin interfaceConnectionFactory- Returns:
- a new
Connection - Throws:
SQLException- if a database error occurs creating the connection
-