isolConnection = (XIsolatedConnection) UnoRuntime.queryInterface(
XIsolatedConnection.class,
oDBSource);
XConnection connection = null;
XStatement statement = null;
final String tbl_name1 = "tst_table1";
final String tbl_name2 = "tst_table2";
final String col_name1 = "id1";
final String col_name2 = "id2";
try {
connection = isolConnection.getIsolatedConnection(user, password);
statement = connection.createStatement();
statement.executeUpdate("drop table if exists " + tbl_name1);
statement.executeUpdate("drop table if exists " + tbl_name2);
statement.executeUpdate("create table " + tbl_name1 + " (" +
col_name1 + " int)");
statement.executeUpdate("create table " + tbl_name2 + " (" +
col_name2 + " int)");
} catch (com.sun.star.sdbc.SQLException e) {
try {
shortWait();
connection = isolConnection.getIsolatedConnection(user,
password);
statement = connection.createStatement();
statement.executeUpdate("drop table if exists " + tbl_name1);
statement.executeUpdate("drop table if exists " + tbl_name2);
statement.executeUpdate("create table " + tbl_name1 + " (" +
col_name1 + " int)");
statement.executeUpdate("create table " + tbl_name2 + " (" +
col_name2 + " int)");
} catch (com.sun.star.sdbc.SQLException e2) {
e2.printStackTrace(log);
throw new StatusException(Status.failed("SQLException"));
}