public final class DataSource extends Object implements AgroalDataSource
AgroalDataSource.FlushMode
Constructor and Description |
---|
DataSource(AgroalDataSourceConfiguration dataSourceConfiguration,
AgroalDataSourceListener... listeners) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush(AgroalDataSource.FlushMode mode) |
AgroalDataSourceConfiguration |
getConfiguration() |
Connection |
getConnection() |
Connection |
getConnection(String username,
String password) |
int |
getLoginTimeout() |
PrintWriter |
getLogWriter() |
AgroalDataSourceMetrics |
getMetrics() |
Logger |
getParentLogger() |
boolean |
isWrapperFor(Class<?> target) |
void |
setLoginTimeout(int seconds) |
void |
setLogWriter(PrintWriter out) |
<T> T |
unwrap(Class<T> target) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
from, from
public DataSource(AgroalDataSourceConfiguration dataSourceConfiguration, AgroalDataSourceListener... listeners)
public AgroalDataSourceConfiguration getConfiguration()
getConfiguration
in interface AgroalDataSource
public AgroalDataSourceMetrics getMetrics()
getMetrics
in interface AgroalDataSource
public void flush(AgroalDataSource.FlushMode mode)
flush
in interface AgroalDataSource
public void close()
close
in interface AgroalDataSource
close
in interface AutoCloseable
public Connection getConnection() throws SQLException
getConnection
in interface DataSource
SQLException
public Connection getConnection(String username, String password) throws SQLException
getConnection
in interface DataSource
SQLException
public <T> T unwrap(Class<T> target) throws SQLException
unwrap
in interface Wrapper
SQLException
public boolean isWrapperFor(Class<?> target) throws SQLException
isWrapperFor
in interface Wrapper
SQLException
public PrintWriter getLogWriter() throws SQLException
getLogWriter
in interface CommonDataSource
SQLException
public void setLogWriter(PrintWriter out) throws SQLException
setLogWriter
in interface CommonDataSource
SQLException
public int getLoginTimeout() throws SQLException
getLoginTimeout
in interface CommonDataSource
SQLException
public void setLoginTimeout(int seconds) throws SQLException
setLoginTimeout
in interface CommonDataSource
SQLException
public Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger
in interface CommonDataSource
SQLFeatureNotSupportedException
Copyright © 2018 JBoss by Red Hat. All rights reserved.