org.opennms.netmgt.config
Interface ClosableDataSource

All Superinterfaces:
CommonDataSource, DataSource, Wrapper
All Known Implementing Classes:
BaseConnectionFactory, C3P0ConnectionFactory, DBPoolConnectionFactory, TomcatJdbcPoolConnectionFactory

public interface ClosableDataSource
extends DataSource

ClosableDataSource interface.


Method Summary
 void close()
          Close the datasource, if necessary.
 void setIdleTimeout(int idleTimeout)
          How long, in seconds, an idle connection is kept in the pool before it is removed.
 void setLoginTimeout(int loginTimeout)
          How long, in seconds, to attempt to make a connection to the database.
 void setMaxPool(int maxPool)
          The maximum number of pooled connections to retain.
 void setMaxSize(int maxSize)
          The maximum number of connections that can be created.
 void setMinPool(int minPool)
          The minimum number of pooled connections to retain.
 
Methods inherited from interface javax.sql.DataSource
getConnection, getConnection
 
Methods inherited from interface javax.sql.CommonDataSource
getLoginTimeout, getLogWriter, setLogWriter
 
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
 

Method Detail

close

void close()
           throws SQLException
Close the datasource, if necessary.

Throws:
SQLException - if any.

setIdleTimeout

void setIdleTimeout(int idleTimeout)
How long, in seconds, an idle connection is kept in the pool before it is removed.

Parameters:
idleTimeout -

setLoginTimeout

void setLoginTimeout(int loginTimeout)
                     throws SQLException
How long, in seconds, to attempt to make a connection to the database.

Specified by:
setLoginTimeout in interface CommonDataSource
Throws:
SQLException

setMinPool

void setMinPool(int minPool)
The minimum number of pooled connections to retain.

Parameters:
minPool -

setMaxPool

void setMaxPool(int maxPool)
The maximum number of pooled connections to retain.

Parameters:
maxPool -

setMaxSize

void setMaxSize(int maxSize)
The maximum number of connections that can be created.

Parameters:
maxSize -


Copyright © 2011. All Rights Reserved.