|
||||||||||
| 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
DataSourceDbConnectionFactory class.
| Constructor Summary | |
|---|---|
DataSourceDbConnectionFactory(DataSource dataSource)
Constructor for DataSourceDbConnectionFactory. |
|
| Method Summary | |
|---|---|
void |
destroy()
destroy |
Connection |
getConnection()
getConnection |
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)
Constructor for DataSourceDbConnectionFactory.
dataSource - a DataSource object.| Method Detail |
|---|
public void destroy()
throws SQLException
destroy
destroy in interface DbConnectionFactorySQLException - if any.
public Connection getConnection()
throws SQLException
getConnection
getConnection in interface DbConnectionFactoryConnection object.
SQLException - if any.
public void init(String dbUrl,
String dbDriver,
String username,
String password)
throws ClassNotFoundException,
SQLException
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 - if any.
SQLException - if any.
public void releaseConnection(Connection connection)
throws SQLException
releaseConnection in interface DbConnectionFactoryconnection - the connection to release
SQLException - if any.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||