|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.core.resource.db.DataSourceDbConnectionFactory
public class DataSourceDbConnectionFactory
| Constructor Summary | |
|---|---|
DataSourceDbConnectionFactory(DataSource dataSource)
|
|
| Method Summary | |
|---|---|
void |
destroy()
Deallocate all the resources that may have been allocated to this database connection factory. |
Connection |
getConnection()
Retrieve a connection from the given database connection pool. |
void |
init(String dbUrl,
String dbDriver,
String username,
String password)
Initialize a database factory with the given URL, driver classname, and database credentials. |
void |
releaseConnection(Connection connection)
Replace a database connection back in the pool of available connections for its parent pool. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataSourceDbConnectionFactory(DataSource dataSource)
| Method Detail |
|---|
public void destroy()
throws SQLException
DbConnectionFactory
destroy in interface DbConnectionFactorySQLException
public Connection getConnection()
throws SQLException
DbConnectionFactory
getConnection in interface DbConnectionFactorySQLException
public void init(String dbUrl,
String dbDriver,
String username,
String password)
throws ClassNotFoundException,
SQLException
DbConnectionFactory
Only one init method should be called.
init in interface DbConnectionFactorydbUrl - the JDBC URL used to retrieve connectionsdbDriver - a fully qualified class name for the JDBC driver that will
handle this JDBC URLusername - the name to use to authenticate us with the databasepassword - the credentials use to authenticate the username
ClassNotFoundException
SQLException
public void releaseConnection(Connection connection)
throws SQLException
DbConnectionFactory
releaseConnection in interface DbConnectionFactoryconnection - the connection to release
SQLException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||