public class DataSourceConnectionProvider extends java.lang.Object implements ConnectionProvider
dataSource.getConnection(username, password)
.Constructor and Description |
---|
DataSourceConnectionProvider(javax.sql.DataSource dataSource) |
DataSourceConnectionProvider(javax.sql.DataSource dataSource,
java.lang.String user,
java.lang.String pass) |
DataSourceConnectionProvider(java.lang.String jndiName) |
DataSourceConnectionProvider(java.lang.String jndiName,
java.lang.String user,
java.lang.String pass) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes a provider and releases all its resources.
|
void |
closeConnection(java.sql.Connection connection)
Dispose of a used
connection . |
java.sql.Connection |
getConnection()
Returns a connection from connection pool.
|
void |
init()
Initialize the connection provider.
|
public DataSourceConnectionProvider(java.lang.String jndiName)
public DataSourceConnectionProvider(java.lang.String jndiName, java.lang.String user, java.lang.String pass)
public DataSourceConnectionProvider(javax.sql.DataSource dataSource)
public DataSourceConnectionProvider(javax.sql.DataSource dataSource, java.lang.String user, java.lang.String pass)
public void init()
ConnectionProvider
init
in interface ConnectionProvider
public java.sql.Connection getConnection()
ConnectionProvider
getConnection
in interface ConnectionProvider
public void closeConnection(java.sql.Connection connection)
ConnectionProvider
connection
.closeConnection
in interface ConnectionProvider
public void close()
ConnectionProvider
close
in interface java.lang.AutoCloseable
close
in interface ConnectionProvider
Copyright © 2003-present Jodd Team