public class DataSourceWrapper
extends java.lang.Object
implements javax.sql.DataSource
A simple DataSource
wrapper for the standard
DriverManager
class.
Constructor and Description |
---|
DataSourceWrapper() |
Modifier and Type | Method and Description |
---|---|
java.sql.Connection |
getConnection()
Returns a Connection using the DriverManager and all
set properties.
|
java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password)
Always throws a SQLException.
|
int |
getLoginTimeout()
Always throws a SQLException.
|
java.io.PrintWriter |
getLogWriter()
Always throws a SQLException.
|
java.util.logging.Logger |
getParentLogger()
Always throws a SQLFeatureNotSupportedException.
|
boolean |
isWrapperFor(java.lang.Class<?> iface)
Always return false.
|
void |
setDriverClassName(java.lang.String driverClassName) |
void |
setJdbcURL(java.lang.String jdbcURL) |
void |
setLoginTimeout(int seconds)
Always throws a SQLException.
|
void |
setLogWriter(java.io.PrintWriter out)
Always throws a SQLException.
|
void |
setPassword(java.lang.String password) |
void |
setUserName(java.lang.String userName) |
<T> T |
unwrap(java.lang.Class<T> iface)
Always throws a SQLException.
|
public void setDriverClassName(java.lang.String driverClassName) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
public void setJdbcURL(java.lang.String jdbcURL)
public void setUserName(java.lang.String userName)
public void setPassword(java.lang.String password)
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
public java.sql.Connection getConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
public int getLoginTimeout() throws java.sql.SQLException
getLoginTimeout
in interface javax.sql.CommonDataSource
java.sql.SQLException
public java.io.PrintWriter getLogWriter() throws java.sql.SQLException
getLogWriter
in interface javax.sql.CommonDataSource
java.sql.SQLException
public void setLoginTimeout(int seconds) throws java.sql.SQLException
setLoginTimeout
in interface javax.sql.CommonDataSource
java.sql.SQLException
public void setLogWriter(java.io.PrintWriter out) throws java.sql.SQLException
setLogWriter
in interface javax.sql.CommonDataSource
java.sql.SQLException
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException
isWrapperFor
in interface java.sql.Wrapper
java.sql.SQLException
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException
unwrap
in interface java.sql.Wrapper
java.sql.SQLException
public java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedException
getParentLogger
in interface javax.sql.CommonDataSource
java.sql.SQLFeatureNotSupportedException