public class MockDataSource extends Object implements DataSource
Constructor and Description |
---|
MockDataSource() |
Modifier and Type | Method and Description |
---|---|
Connection |
getConnection() |
Connection |
getConnection(String username,
String password) |
int |
getLoginTimeout() |
PrintWriter |
getLogWriter() |
Logger |
getParentLogger()
NOTE: JDK7+ new feature
|
boolean |
isWrapperFor(Class<?> iface) |
void |
setLoginTimeout(int seconds) |
void |
setLogWriter(PrintWriter out) |
<T> T |
unwrap(Class<T> iface) |
public Logger getParentLogger()
getParentLogger
in interface CommonDataSource
public Connection getConnection() throws SQLException
getConnection
in interface DataSource
SQLException
DataSource.getConnection()
public Connection getConnection(String username, String password) throws SQLException
getConnection
in interface DataSource
SQLException
DataSource.getConnection(java.lang.String, java.lang.String)
public PrintWriter getLogWriter() throws SQLException
getLogWriter
in interface CommonDataSource
SQLException
CommonDataSource.getLogWriter()
public int getLoginTimeout() throws SQLException
getLoginTimeout
in interface CommonDataSource
SQLException
CommonDataSource.getLoginTimeout()
public void setLogWriter(PrintWriter out) throws SQLException
setLogWriter
in interface CommonDataSource
SQLException
CommonDataSource.setLogWriter(java.io.PrintWriter)
public void setLoginTimeout(int seconds) throws SQLException
setLoginTimeout
in interface CommonDataSource
SQLException
CommonDataSource.setLoginTimeout(int)
public boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor
in interface Wrapper
SQLException
public <T> T unwrap(Class<T> iface) throws SQLException
unwrap
in interface Wrapper
SQLException
Copyright © 1995-2016 Webtide. All Rights Reserved.