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.ClassNotFoundExceptionjava.lang.InstantiationExceptionjava.lang.IllegalAccessExceptionpublic 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.DataSourcejava.sql.SQLExceptionpublic java.sql.Connection getConnection(java.lang.String username,
java.lang.String password)
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcejava.sql.SQLExceptionpublic int getLoginTimeout()
throws java.sql.SQLException
getLoginTimeout in interface javax.sql.CommonDataSourcejava.sql.SQLExceptionpublic java.io.PrintWriter getLogWriter()
throws java.sql.SQLException
getLogWriter in interface javax.sql.CommonDataSourcejava.sql.SQLExceptionpublic void setLoginTimeout(int seconds)
throws java.sql.SQLException
setLoginTimeout in interface javax.sql.CommonDataSourcejava.sql.SQLExceptionpublic void setLogWriter(java.io.PrintWriter out)
throws java.sql.SQLException
setLogWriter in interface javax.sql.CommonDataSourcejava.sql.SQLExceptionpublic boolean isWrapperFor(java.lang.Class<?> iface)
throws java.sql.SQLException
isWrapperFor in interface java.sql.Wrapperjava.sql.SQLExceptionpublic <T> T unwrap(java.lang.Class<T> iface)
throws java.sql.SQLException
unwrap in interface java.sql.Wrapperjava.sql.SQLExceptionpublic java.util.logging.Logger getParentLogger()
throws java.sql.SQLFeatureNotSupportedException
getParentLogger in interface javax.sql.CommonDataSourcejava.sql.SQLFeatureNotSupportedExceptionCopyright (c) 1999-2012 Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.