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. |
DataSource |
getDataSource() |
String |
getUserName() |
char[] |
getUserPassword() |
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 connectionpublic DataSource getDataSource()
public String getUserName()
public char[] getUserPassword()
Copyright © 2001–2019 The Apache Software Foundation. All rights reserved.