public class MuleDerbyTestDatabase extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DERBY_PROPERTIES_FILE |
| Constructor and Description |
|---|
MuleDerbyTestDatabase(String databaseNameProperty) |
| Modifier and Type | Method and Description |
|---|---|
void |
emptyTestTable()
Remove all the rows from TEST table.
|
List |
execSqlQuery(String sql)
Executes a query against the database.
|
int |
execSqlUpdate(String sql)
Executes an SQL statement against the database.
|
Connection |
getConnection() |
void |
insertIntoTest(String data,
int type)
Inserts a record in the TEST table.
|
void |
startDatabase()
Creates an empty database with a table named TEST.
|
void |
stopDatabase()
Stops the created database.
|
public static final String DERBY_PROPERTIES_FILE
public MuleDerbyTestDatabase(String databaseNameProperty)
databaseNameProperty - name of the property with the database name in derby.properties file.
To add a new database change derby.properties file.public void startDatabase()
throws Exception
Exceptionpublic void stopDatabase()
throws SQLException
SQLExceptionpublic void emptyTestTable()
throws Exception
SQLExceptionExceptionpublic void insertIntoTest(String data, int type)
public Connection getConnection() throws Exception
Exceptionpublic List execSqlQuery(String sql) throws Exception
sql - SQL queryExceptionCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.