return idxCol;
}
}
public static void prepareDB(Connection conn) throws SQLException {
DBType type = DBType.ORACLE;
if (Schema.isHsqlConnection(conn)) {
type = DBType.HSQL;
}
else {
if (Schema.isMySqlConnection(conn)) {
type = DBType.MySQL;
}
}
if (!type.equals(DBType.ORACLE)) {
conn.prepareStatement(
"CREATE " + (type.equals(DBType.MySQL) ? "DATABASE " : "SCHEMA ") + DB_NAME
+ (type.equals(DBType.HSQL) ? " AUTHORIZATION DBA" : "")).execute();
}
for (Table table : TABLE_COLUMNS.keySet()) {
String createStmt = Schema.generateCreateTableScript(table, type, TABLE_COLUMNS.get(table));
conn.prepareStatement(createStmt).execute();
}