Package org.apache.tomcat.dbcp.dbcp2
Class DataSourceConnectionFactory
java.lang.Object
org.apache.tomcat.dbcp.dbcp2.DataSourceConnectionFactory
- All Implemented Interfaces:
- ConnectionFactory
A 
DataSource-based implementation of ConnectionFactory.- Since:
- 2.0
- 
Constructor SummaryConstructorsConstructorDescriptionDataSourceConnectionFactory(DataSource dataSource) Constructs an instance for the given DataSource.DataSourceConnectionFactory(DataSource dataSource, String userName, char[] userPassword) Constructs an instance for the given DataSource.DataSourceConnectionFactory(DataSource dataSource, String userName, String password) Constructs an instance for the given DataSource.
- 
Method SummaryModifier and TypeMethodDescriptionCreate a newConnectionin an implementation specific fashion.char[]
- 
Constructor Details- 
DataSourceConnectionFactoryConstructs an instance for the given DataSource.- Parameters:
- dataSource- The DataSource for this factory.
 
- 
DataSourceConnectionFactoryConstructs an instance for the given DataSource.- Parameters:
- dataSource- The DataSource for this factory.
- userName- The user name.
- userPassword- The user password.
- Since:
- 2.4.0
 
- 
DataSourceConnectionFactoryConstructs an instance for the given DataSource.- Parameters:
- dataSource- The DataSource for this factory.
- userName- The user name.
- password- The user password.
 
 
- 
- 
Method Details- 
createConnectionDescription copied from interface:ConnectionFactoryCreate a newConnectionin an implementation specific fashion.- Specified by:
- createConnectionin interface- ConnectionFactory
- Returns:
- a new Connection
- Throws:
- SQLException- if a database error occurs creating the connection
 
- 
getDataSource- Returns:
- The data source.
- Since:
- 2.6.0
 
- 
getUserName- Returns:
- The user name.
- Since:
- 2.6.0
 
- 
getUserPasswordpublic char[] getUserPassword()- Returns:
- The user password.
- Since:
- 2.6.0
 
 
-