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.DataSourceSQLExceptionpublic Connection getConnection(String userName,
String password)
throws SQLException
getConnection in interface javax.sql.DataSourceSQLExceptionpublic int getLoginTimeout()
throws SQLException
getLoginTimeout in interface javax.sql.CommonDataSourceSQLExceptionpublic PrintWriter getLogWriter()
throws SQLException
getLogWriter in interface javax.sql.CommonDataSourceSQLExceptionpublic Logger getParentLogger()
throws SQLFeatureNotSupportedException
getParentLogger in interface javax.sql.CommonDataSourceSQLFeatureNotSupportedExceptionpublic javax.sql.DataSource getReadDataSource()
public javax.sql.DataSource getWriteDataSource()
public boolean isWrapperFor(Class<?> clazz)
throws SQLException
isWrapperFor in interface WrapperSQLExceptionpublic void setLoginTimeout(int seconds)
throws SQLException
setLoginTimeout in interface javax.sql.CommonDataSourceSQLExceptionpublic void setLogWriter(PrintWriter printWriter)
throws SQLException
setLogWriter in interface javax.sql.CommonDataSourceSQLExceptionpublic <T> T unwrap(Class<T> clazz)
throws SQLException
unwrap in interface WrapperSQLException