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
Exception
public void stopDatabase() throws SQLException
SQLException
public void emptyTestTable() throws Exception
SQLException
Exception
public void insertIntoTest(String data, int type)
public Connection getConnection() throws Exception
Exception
public List execSqlQuery(String sql) throws Exception
sql
- SQL queryException
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.