Package org.apache.commons.dbcp2
Class DriverConnectionFactory
java.lang.Object
org.apache.commons.dbcp2.DriverConnectionFactory
- All Implemented Interfaces:
ConnectionFactory
A
Driver-based implementation of ConnectionFactory.- Since:
- 2.0
-
Constructor Summary
ConstructorsConstructorDescriptionDriverConnectionFactory(Driver driver, String connectString, Properties properties) Constructs a connection factory for a given Driver. -
Method Summary
Modifier and TypeMethodDescriptionCreate a newConnectionin an implementation specific fashion.Gets the connection String.Gets the JDBC Driver.Gets the properties.toString()
-
Constructor Details
-
DriverConnectionFactory
Constructs a connection factory for a given Driver.- Parameters:
driver- The Driver.connectString- The connection string.properties- The connection properties.
-
-
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
-
getConnectionString
Gets the connection String.- Returns:
- The connection String.
- Since:
- 2.6.0
-
getDriver
Gets the JDBC Driver.- Returns:
- The JDBC Driver.
- Since:
- 2.6.0
-
getProperties
Gets the properties.- Returns:
- The properties.
- Since:
- 2.6.0
-
toString
-