public class TemporaryDatabaseHsqldb extends Object implements TemporaryDatabase, org.springframework.beans.factory.InitializingBean
ADMIN_PASSWORD_PROPERTY, ADMIN_USER_PROPERTY, DEFAULT_ADMIN_PASSWORD, DEFAULT_ADMIN_USER, DEFAULT_DRIVER, DEFAULT_URL, DRIVER_PROPERTY, TEST_DB_NAME_PREFIX, URL_PROPERTY
Constructor and Description |
---|
TemporaryDatabaseHsqldb() |
TemporaryDatabaseHsqldb(String testDatabase) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
int |
countRows(String sql,
Object... values) |
void |
create() |
void |
drop() |
Connection |
getConnection() |
Connection |
getConnection(String username,
String password) |
DataSource |
getDataSource() |
org.springframework.jdbc.core.JdbcTemplate |
getJdbcTemplate() |
int |
getLoginTimeout() |
PrintWriter |
getLogWriter() |
Logger |
getParentLogger() |
boolean |
getPopulateSchema() |
String |
getTestDatabase() |
XAConnection |
getXAConnection()
TODO Implement these functions to use the XADataSource implementation
from HSQLDB
|
XAConnection |
getXAConnection(String user,
String password)
TODO Implement these functions to use the XADataSource implementation
from HSQLDB
|
boolean |
isWrapperFor(Class<?> iface) |
void |
setDataSource(DataSource dataSource) |
void |
setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate template) |
void |
setLoginTimeout(int seconds) |
void |
setLogWriter(PrintWriter out) |
void |
setPopulateSchema(boolean populate) |
<T> T |
unwrap(Class<T> iface) |
public TemporaryDatabaseHsqldb()
public TemporaryDatabaseHsqldb(String testDatabase)
public DataSource getDataSource()
public void setDataSource(DataSource dataSource)
public void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
public Connection getConnection() throws SQLException
getConnection
in interface DataSource
SQLException
public Connection getConnection(String username, String password) throws SQLException
getConnection
in interface DataSource
SQLException
public Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger
in interface CommonDataSource
SQLFeatureNotSupportedException
public PrintWriter getLogWriter() throws SQLException
getLogWriter
in interface CommonDataSource
SQLException
public void setLogWriter(PrintWriter out) throws SQLException
setLogWriter
in interface CommonDataSource
SQLException
public void setLoginTimeout(int seconds) throws SQLException
setLoginTimeout
in interface CommonDataSource
SQLException
public int getLoginTimeout() throws SQLException
getLoginTimeout
in interface CommonDataSource
SQLException
public <T> T unwrap(Class<T> iface) throws SQLException
unwrap
in interface Wrapper
SQLException
public boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor
in interface Wrapper
SQLException
public String getTestDatabase()
getTestDatabase
in interface TemporaryDatabase
public boolean getPopulateSchema()
public void setPopulateSchema(boolean populate)
setPopulateSchema
in interface TemporaryDatabase
public void create() throws TemporaryDatabaseException
create
in interface TemporaryDatabase
TemporaryDatabaseException
public void drop() throws TemporaryDatabaseException
drop
in interface TemporaryDatabase
TemporaryDatabaseException
public int countRows(String sql, Object... values)
countRows
in interface TemporaryDatabase
public org.springframework.jdbc.core.JdbcTemplate getJdbcTemplate()
getJdbcTemplate
in interface TemporaryDatabase
public void setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate template)
public XAConnection getXAConnection() throws SQLException
getXAConnection
in interface XADataSource
SQLException
public XAConnection getXAConnection(String user, String password) throws SQLException
getXAConnection
in interface XADataSource
SQLException
Copyright © 2016. All rights reserved.