public abstract class EmbeddedDB extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
EmbeddedDB.DBEngine |
protected static class |
EmbeddedDB.ResultSetJob |
| Modifier and Type | Field and Description |
|---|---|
protected List<String> |
allTables |
protected String |
databaseName |
protected DataSource |
dataSource |
protected String |
jdbcConnectionString |
protected static org.slf4j.Logger |
logger |
protected String |
password |
protected String |
username |
| Modifier | Constructor and Description |
|---|---|
protected |
EmbeddedDB(String databaseName,
String username,
String password,
String jdbcConnectionString) |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanupAllTables() |
void |
cleanupTable(String table) |
protected DataSource |
createHikariDataSource() |
protected void |
execute(String query) |
protected void |
execute(String query,
EmbeddedDB.ResultSetJob job) |
protected void |
executeQuery(String query,
EmbeddedDB.ResultSetJob job) |
void |
executeScript(String script) |
protected int |
executeUpdate(String query) |
List<String> |
getAllTables() |
String |
getCmdLineConnectionString() |
protected Connection |
getConnection() |
String |
getDatabaseName() |
DataSource |
getDataSource() |
abstract EmbeddedDB.DBEngine |
getDBEngine() |
String |
getJdbcConnectionString() |
String |
getPassword() |
protected int |
getPort() |
String |
getUsername() |
abstract void |
initialize() |
abstract void |
refreshTableNames() |
void |
setDataSource(DataSource dataSource) |
abstract void |
start() |
void |
stop() |
boolean |
useConnectionPooling() |
protected static final org.slf4j.Logger logger
protected String databaseName
protected String username
protected String password
protected String jdbcConnectionString
protected DataSource dataSource
public boolean useConnectionPooling()
public abstract EmbeddedDB.DBEngine getDBEngine()
public abstract void initialize()
throws IOException,
SQLException
IOExceptionSQLExceptionpublic abstract void start()
throws IOException,
SQLException
IOExceptionSQLExceptionpublic abstract void refreshTableNames()
throws IOException
IOExceptionpublic DataSource getDataSource() throws IOException
IOExceptionpublic void setDataSource(DataSource dataSource)
public void stop()
throws IOException
IOExceptionpublic String getCmdLineConnectionString()
public String getUsername()
public String getPassword()
public String getDatabaseName()
public String getJdbcConnectionString()
protected DataSource createHikariDataSource() throws IOException
IOExceptionpublic void executeScript(String script) throws IOException
IOExceptionpublic void cleanupAllTables()
throws IOException
IOExceptionpublic void cleanupTable(String table) throws IOException
IOExceptionprotected void execute(String query) throws SQLException, IOException
SQLExceptionIOExceptionprotected void execute(String query, EmbeddedDB.ResultSetJob job) throws SQLException, IOException
SQLExceptionIOExceptionprotected int executeUpdate(String query) throws SQLException, IOException
SQLExceptionIOExceptionprotected void executeQuery(String query, EmbeddedDB.ResultSetJob job) throws SQLException, IOException
SQLExceptionIOExceptionprotected Connection getConnection() throws SQLException, IOException
SQLExceptionIOExceptionprotected int getPort()
Copyright © 2010–2020. All rights reserved.