Package org.opennms.core.db
Interface ClosableDataSource
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
,javax.sql.CommonDataSource
,javax.sql.DataSource
,java.sql.Wrapper
- All Known Implementing Classes:
AtomikosDataSourceFactory
,BaseConnectionFactory
,C3P0ConnectionFactory
,HikariCPConnectionFactory
public interface ClosableDataSource extends javax.sql.DataSource, java.io.Closeable
ClosableDataSource interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.CommonDataSource
createShardingKeyBuilder, getParentLogger
-
-
-
-
Method Detail
-
close
void close()
Close the datasource, if necessary.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
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 java.sql.SQLException
How long, in seconds, to attempt to make a connection to the database.- Specified by:
setLoginTimeout
in interfacejavax.sql.CommonDataSource
- Specified by:
setLoginTimeout
in interfacejavax.sql.DataSource
- Throws:
java.sql.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
-
-
-