public class MockDataSource extends Object implements DataSource
DataSource.| Constructor and Description |
|---|
MockDataSource() |
| Modifier and Type | Method and Description |
|---|---|
Connection |
getConnection() |
Connection |
getConnection(String username,
String password) |
int |
getLoginTimeout() |
PrintWriter |
getLogWriter() |
MockConnection |
getMockConnection()
Returns the
MockConnection. |
Logger |
getParentLogger() |
boolean |
isWrapperFor(Class iface) |
void |
setLoginTimeout(int seconds) |
void |
setLogWriter(PrintWriter out) |
void |
setParentLogger(Logger parentLogger) |
void |
setupConnection(Connection connection)
Set up the connection.
|
Object |
unwrap(Class iface) |
public void setupConnection(Connection connection)
connection - the connectionpublic MockConnection getMockConnection()
MockConnection.
If the underlying connection is not an instance of
MockConnection,
null is returned.MockConnectionpublic int getLoginTimeout()
throws SQLException
getLoginTimeout in interface CommonDataSourceSQLExceptionpublic void setLoginTimeout(int seconds)
throws SQLException
setLoginTimeout in interface CommonDataSourceSQLExceptionpublic PrintWriter getLogWriter() throws SQLException
getLogWriter in interface CommonDataSourceSQLExceptionpublic void setLogWriter(PrintWriter out) throws SQLException
setLogWriter in interface CommonDataSourceSQLExceptionpublic Connection getConnection() throws SQLException
getConnection in interface DataSourceSQLExceptionpublic Connection getConnection(String username, String password) throws SQLException
getConnection in interface DataSourceSQLExceptionpublic boolean isWrapperFor(Class iface) throws SQLException
isWrapperFor in interface WrapperSQLExceptionpublic Object unwrap(Class iface) throws SQLException
unwrap in interface WrapperSQLExceptionpublic Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger in interface CommonDataSourceSQLFeatureNotSupportedExceptionpublic void setParentLogger(Logger parentLogger)
Copyright © 2003-2014. All Rights Reserved.