Methods Summary |
---|
public void | close()
|
public void | closeConnection(java.sql.Connection conn)
conn.close();
|
public void | configure(java.util.Properties props)
String jndiName = props.getProperty(Environment.DATASOURCE);
if (jndiName==null) {
String msg = "datasource JNDI name was not specified by property " + Environment.DATASOURCE;
log.fatal(msg);
throw new HibernateException(msg);
}
user = props.getProperty(Environment.USER);
pass = props.getProperty(Environment.PASS);
try {
ds = (DataSource) NamingHelper.getInitialContext(props).lookup(jndiName);
}
catch (Exception e) {
log.fatal( "Could not find datasource: " + jndiName, e );
throw new HibernateException( "Could not find datasource", e );
}
if (ds==null) {
throw new HibernateException( "Could not find datasource: " + jndiName );
}
log.info( "Using datasource: " + jndiName );
|
public java.sql.Connection | getConnection()
if (user != null || pass != null) {
return ds.getConnection(user, pass);
}
else {
return ds.getConnection();
}
|
public javax.sql.DataSource | getDataSource()
return ds;
|
public void | setDataSource(javax.sql.DataSource ds)
this.ds = ds;
|
public boolean | supportsAggressiveRelease()
return true;
|