public class InjectedDataSourceConnectionProvider extends DatasourceConnectionProvider
DatasourceConnectionProvider
which uses the DataSource
specified vi
setDataSource(javax.sql.DataSource)
rather than locating it from JNDI.
NOTE : setDataSource(javax.sql.DataSource)
must be called prior to configure(java.util.Properties)
.
TODO : could not find where #setDataSource is actually called. Can't this just be passed in to #configure???Constructor and Description |
---|
InjectedDataSourceConnectionProvider() |
Modifier and Type | Method and Description |
---|---|
void |
configure(Properties props)
Initialize the connection provider from given properties.
|
Connection |
getConnection()
Grab a connection, with the autocommit mode specified by
hibernate.connection.autocommit.
|
void |
setDataSource(DataSource ds) |
close, closeConnection, getDataSource, supportsAggressiveRelease
public InjectedDataSourceConnectionProvider()
public void setDataSource(DataSource ds)
setDataSource
in class DatasourceConnectionProvider
public void configure(Properties props) throws HibernateException
ConnectionProvider
configure
in interface ConnectionProvider
configure
in class DatasourceConnectionProvider
props
- SessionFactory propertiesHibernateException
public Connection getConnection() throws SQLException
ConnectionProvider
getConnection
in interface ConnectionProvider
getConnection
in class DatasourceConnectionProvider
SQLException
Copyright © 2002-2015 Red Hat Middleware, LLC. All Rights Reserved