public class DynamicDataSource
extends Object
implements javax.sql.DataSource
Constructor and Description |
---|
DynamicDataSource(javax.sql.DataSource readDataSource,
javax.sql.DataSource writeDataSource) |
Modifier and Type | Method and Description |
---|---|
Connection |
getConnection() |
Connection |
getConnection(String userName,
String password) |
int |
getLoginTimeout() |
PrintWriter |
getLogWriter() |
Logger |
getParentLogger() |
javax.sql.DataSource |
getReadDataSource() |
javax.sql.DataSource |
getWriteDataSource() |
boolean |
isWrapperFor(Class<?> clazz) |
void |
setLoginTimeout(int seconds) |
void |
setLogWriter(PrintWriter printWriter) |
<T> T |
unwrap(Class<T> clazz) |
public DynamicDataSource(javax.sql.DataSource readDataSource, javax.sql.DataSource writeDataSource)
public Connection getConnection() throws SQLException
getConnection
in interface javax.sql.DataSource
SQLException
public Connection getConnection(String userName, String password) throws SQLException
getConnection
in interface javax.sql.DataSource
SQLException
public int getLoginTimeout() throws SQLException
getLoginTimeout
in interface javax.sql.CommonDataSource
SQLException
public PrintWriter getLogWriter() throws SQLException
getLogWriter
in interface javax.sql.CommonDataSource
SQLException
public Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger
in interface javax.sql.CommonDataSource
SQLFeatureNotSupportedException
public javax.sql.DataSource getReadDataSource()
public javax.sql.DataSource getWriteDataSource()
public boolean isWrapperFor(Class<?> clazz) throws SQLException
isWrapperFor
in interface Wrapper
SQLException
public void setLoginTimeout(int seconds) throws SQLException
setLoginTimeout
in interface javax.sql.CommonDataSource
SQLException
public void setLogWriter(PrintWriter printWriter) throws SQLException
setLogWriter
in interface javax.sql.CommonDataSource
SQLException
public <T> T unwrap(Class<T> clazz) throws SQLException
unwrap
in interface Wrapper
SQLException