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
ConstructorDescriptionDriverConnectionFactory
(Driver driver, String connectString, Properties properties) Constructs a connection factory for a given Driver. -
Method Summary
Modifier and TypeMethodDescriptionCreate a newConnection
in an implementation specific fashion.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: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
-
getConnectionString
- Returns:
- The connection String.
- Since:
- 2.6.0
-
getDriver
- Returns:
- The Driver.
- Since:
- 2.6.0
-
getProperties
- Returns:
- The Properties.
- Since:
- 2.6.0
-
toString
-