public class DataSourceConnectionFactory extends Object implements ConnectionFactory
DataSource
-based implementation of ConnectionFactory
.Constructor and Description |
---|
DataSourceConnectionFactory(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.
|
Modifier and Type | Method and Description |
---|---|
Connection |
createConnection()
Create a new
Connection in an implementation specific fashion. |
public DataSourceConnectionFactory(DataSource dataSource)
dataSource
- The DataSource for this factory.public DataSourceConnectionFactory(DataSource dataSource, String userName, char[] userPassword)
dataSource
- The DataSource for this factory.userName
- The user name.userPassword
- The user password.public DataSourceConnectionFactory(DataSource dataSource, String userName, String password)
dataSource
- The DataSource for this factory.userName
- The user name.password
- The user password.public Connection createConnection() throws SQLException
ConnectionFactory
Connection
in an implementation specific fashion.createConnection
in interface ConnectionFactory
Connection
SQLException
- if a database error occurs creating the connectionCopyright © 2001–2018 The Apache Software Foundation. All rights reserved.