@Beta public final class PooledDataSource extends Object implements DataSource, AutoCloseable
Constructor and Description |
---|
PooledDataSource(int initialSize,
int maxSize,
RecyclingSupplier.Factory<Connection> jdbcConnectionFactory) |
PooledDataSource(int initialSize,
int maxSize,
String driverName,
String url,
Properties properties,
int loginTimeoutSeconds) |
PooledDataSource(int initialSize,
int maxSize,
String driverName,
String url,
String user,
String password) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
Connection |
getConnection() |
Connection |
getConnection(String username,
String password) |
int |
getLoginTimeout() |
PrintWriter |
getLogWriter() |
Logger |
getParentLogger() |
boolean |
isWrapperFor(Class<?> iface) |
void |
setLoginTimeout(int seconds) |
void |
setLogWriter(PrintWriter out) |
String |
toString() |
<T> T |
unwrap(Class<T> iface) |
public PooledDataSource(int initialSize, int maxSize, String driverName, String url, String user, String password) throws ObjectCreationException
ObjectCreationException
public PooledDataSource(int initialSize, int maxSize, String driverName, String url, Properties properties, int loginTimeoutSeconds) throws ObjectCreationException
ObjectCreationException
public PooledDataSource(int initialSize, int maxSize, RecyclingSupplier.Factory<Connection> jdbcConnectionFactory) throws ObjectCreationException
ObjectCreationException
public Connection getConnection() throws SQLException
getConnection
in interface DataSource
SQLException
public Connection getConnection(String username, String password) throws SQLFeatureNotSupportedException
getConnection
in interface DataSource
SQLFeatureNotSupportedException
public PrintWriter getLogWriter() throws SQLFeatureNotSupportedException
getLogWriter
in interface CommonDataSource
SQLFeatureNotSupportedException
public void setLogWriter(PrintWriter out) throws SQLFeatureNotSupportedException
setLogWriter
in interface CommonDataSource
SQLFeatureNotSupportedException
public void setLoginTimeout(int seconds) throws SQLFeatureNotSupportedException
setLoginTimeout
in interface CommonDataSource
SQLFeatureNotSupportedException
public int getLoginTimeout() throws SQLFeatureNotSupportedException
getLoginTimeout
in interface CommonDataSource
SQLFeatureNotSupportedException
public <T> T unwrap(Class<T> iface) throws SQLException
unwrap
in interface Wrapper
SQLException
public boolean isWrapperFor(Class<?> iface)
isWrapperFor
in interface Wrapper
public Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger
in interface CommonDataSource
SQLFeatureNotSupportedException
public void close() throws ObjectDisposeException, InterruptedException
close
in interface AutoCloseable
ObjectDisposeException
InterruptedException
Copyright © 2018 SPF4J. All rights reserved.