Package org.apache.tomcat.dbcp.dbcp2
Class DriverConnectionFactory
- java.lang.Object
-
- org.apache.tomcat.dbcp.dbcp2.DriverConnectionFactory
-
- All Implemented Interfaces:
ConnectionFactory
public class DriverConnectionFactory extends Object implements ConnectionFactory
ADriver-based implementation ofConnectionFactory.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description DriverConnectionFactory(Driver driver, String connectString, Properties properties)Constructs a connection factory for a given Driver.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectioncreateConnection()Create a newConnectionin an implementation specific fashion.StringgetConnectionString()DrivergetDriver()PropertiesgetProperties()StringtoString()
-
-
-
Constructor Detail
-
DriverConnectionFactory
public DriverConnectionFactory(Driver driver, String connectString, Properties properties)
Constructs a connection factory for a given Driver.- Parameters:
driver- The Driver.connectString- The connection string.properties- The connection properties.
-
-
Method Detail
-
createConnection
public Connection createConnection() throws SQLException
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
public String getConnectionString()
- Returns:
- The connection String.
- Since:
- 2.6.0
-
getDriver
public Driver getDriver()
- Returns:
- The Driver.
- Since:
- 2.6.0
-
getProperties
public Properties getProperties()
- Returns:
- The Properties.
- Since:
- 2.6.0
-
-