public class DataSourceWrapper extends Object implements DataSource
A simple DataSource wrapper for the standard
DriverManager class.
| Constructor and Description |
|---|
DataSourceWrapper() |
| Modifier and Type | Method and Description |
|---|---|
Connection |
getConnection()
Returns a Connection using the DriverManager and all
set properties.
|
Connection |
getConnection(String username,
String password)
Always throws a SQLException.
|
int |
getLoginTimeout()
Always throws a SQLException.
|
PrintWriter |
getLogWriter()
Always throws a SQLException.
|
Logger |
getParentLogger()
Always throws a SQLFeatureNotSupportedException.
|
boolean |
isWrapperFor(Class<?> iface)
Always return false.
|
void |
setDriverClassName(String driverClassName) |
void |
setJdbcURL(String jdbcURL) |
void |
setLoginTimeout(int seconds)
Always throws a SQLException.
|
void |
setLogWriter(PrintWriter out)
Always throws a SQLException.
|
void |
setPassword(String password) |
void |
setUserName(String userName) |
<T> T |
unwrap(Class<T> iface)
Always throws a SQLException.
|
public void setDriverClassName(String driverClassName) throws ClassNotFoundException, InstantiationException, IllegalAccessException
public void setJdbcURL(String jdbcURL)
public void setUserName(String userName)
public void setPassword(String password)
public Connection getConnection() throws SQLException
getConnection in interface DataSourceSQLExceptionpublic Connection getConnection(String username, String password) throws SQLException
getConnection in interface DataSourceSQLExceptionpublic int getLoginTimeout()
throws SQLException
getLoginTimeout in interface CommonDataSourceSQLExceptionpublic PrintWriter getLogWriter() throws SQLException
getLogWriter in interface CommonDataSourceSQLExceptionpublic void setLoginTimeout(int seconds)
throws SQLException
setLoginTimeout in interface CommonDataSourceSQLExceptionpublic void setLogWriter(PrintWriter out) throws SQLException
setLogWriter in interface CommonDataSourceSQLExceptionpublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor in interface WrapperSQLExceptionpublic <T> T unwrap(Class<T> iface) throws SQLException
unwrap in interface WrapperSQLExceptionpublic Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger in interface CommonDataSourceSQLFeatureNotSupportedExceptionCopyright © 2017 JBoss, a division of Red Hat, Inc.. All Rights Reserved.