Package io.agroal.pool
Class DataSource
java.lang.Object
io.agroal.pool.DataSource
- All Implemented Interfaces:
AgroalDataSource
,Serializable
,AutoCloseable
,Wrapper
,CommonDataSource
,DataSource
- Author:
- Luis Barreiro
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.agroal.api.AgroalDataSource
AgroalDataSource.FlushMode
-
Constructor Summary
ConstructorDescriptionDataSource
(AgroalDataSourceConfiguration dataSourceConfiguration, AgroalDataSourceListener... listeners) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
getConnection
(String username, String password) int
boolean
isHealthy
(boolean newConnection) boolean
isWrapperFor
(Class<?> target) void
setLoginTimeout
(int seconds) void
setLogWriter
(PrintWriter out) void
setPoolInterceptors
(Collection<? extends AgroalPoolInterceptor> interceptors) <T> T
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder
Methods inherited from interface javax.sql.DataSource
createConnectionBuilder
-
Constructor Details
-
DataSource
public DataSource(AgroalDataSourceConfiguration dataSourceConfiguration, AgroalDataSourceListener... listeners)
-
-
Method Details
-
setPoolInterceptors
- Specified by:
setPoolInterceptors
in interfaceAgroalDataSource
-
getPoolInterceptors
- Specified by:
getPoolInterceptors
in interfaceAgroalDataSource
-
getConfiguration
- Specified by:
getConfiguration
in interfaceAgroalDataSource
-
getMetrics
- Specified by:
getMetrics
in interfaceAgroalDataSource
-
flush
- Specified by:
flush
in interfaceAgroalDataSource
-
isHealthy
- Specified by:
isHealthy
in interfaceAgroalDataSource
- Throws:
SQLException
-
close
public void close()- Specified by:
close
in interfaceAgroalDataSource
- Specified by:
close
in interfaceAutoCloseable
-
getConnection
- Specified by:
getConnection
in interfaceDataSource
- Throws:
SQLException
-
getConnection
- Specified by:
getConnection
in interfaceDataSource
- Throws:
SQLException
-
unwrap
- Specified by:
unwrap
in interfaceWrapper
- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperFor
in interfaceWrapper
- Throws:
SQLException
-
getLogWriter
- Specified by:
getLogWriter
in interfaceCommonDataSource
- Specified by:
getLogWriter
in interfaceDataSource
- Throws:
SQLException
-
setLogWriter
- Specified by:
setLogWriter
in interfaceCommonDataSource
- Specified by:
setLogWriter
in interfaceDataSource
- Throws:
SQLException
-
getLoginTimeout
- Specified by:
getLoginTimeout
in interfaceCommonDataSource
- Specified by:
getLoginTimeout
in interfaceDataSource
- Throws:
SQLException
-
setLoginTimeout
- Specified by:
setLoginTimeout
in interfaceCommonDataSource
- Specified by:
setLoginTimeout
in interfaceDataSource
- Throws:
SQLException
-
getParentLogger
- Specified by:
getParentLogger
in interfaceCommonDataSource
- Throws:
SQLFeatureNotSupportedException
-