public class DataSourceConnectionFactory extends java.lang.Object implements ConnectionFactory
DataSource
-based implementation of ConnectionFactory
.Constructor and Description |
---|
DataSourceConnectionFactory(javax.sql.DataSource dataSource)
Constructs an instance for the given DataSource.
|
DataSourceConnectionFactory(javax.sql.DataSource dataSource,
java.lang.String userName,
char[] userPassword)
Constructs an instance for the given DataSource.
|
DataSourceConnectionFactory(javax.sql.DataSource dataSource,
java.lang.String userName,
java.lang.String password)
Constructs an instance for the given DataSource.
|
Modifier and Type | Method and Description |
---|---|
java.sql.Connection |
createConnection()
Create a new
Connection in an implementation specific fashion. |
public DataSourceConnectionFactory(javax.sql.DataSource dataSource)
dataSource
- The DataSource for this factory.public DataSourceConnectionFactory(javax.sql.DataSource dataSource, java.lang.String userName, char[] userPassword)
dataSource
- The DataSource for this factory.userName
- The user name.userPassword
- The user password.public DataSourceConnectionFactory(javax.sql.DataSource dataSource, java.lang.String userName, java.lang.String password)
dataSource
- The DataSource for this factory.userName
- The user name.password
- The user password.public java.sql.Connection createConnection() throws java.sql.SQLException
ConnectionFactory
Connection
in an implementation specific fashion.createConnection
in interface ConnectionFactory
Connection
java.sql.SQLException
- if a database error occurs creating the connectionCopyright © 2000-2018 Apache Software Foundation. All Rights Reserved.