Skip to content

Commit

Permalink
GEOS-7062: fix app-schema online test with Oracle.
Browse files Browse the repository at this point in the history
  • Loading branch information
riniangreani committed Jul 29, 2016
1 parent 43d4aba commit 4898d51
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
Expand Up @@ -66,7 +66,7 @@ protected void runSqlInsertScript() throws Exception {
for (String sql : sqls) {
if (sql.startsWith("CALL")) {
String formattedSP = "{" + sql + "}";
this.runOracleStoreProcedure(formattedSP);
this.run(formattedSP);
continue;
}
this.run(sql);
Expand All @@ -78,7 +78,7 @@ protected void runSqlInsertScript() throws Exception {
// these private helper class might be useful in the future. feel free to change its access
// modifier
private void setDataVersion(double version) throws Exception {
this.runOracleStoreProcedure("{CALL DROP_TABLE('" + versiontbl + "')}");
this.run("{CALL DROP_TABLE('" + versiontbl + "')}");
this.run("CREATE TABLE " + versiontbl + " (" + "NAME VARCHAR2(100 BYTE) NOT NULL, "
+ "VERSION NUMBER(25,2)," + "INSERT_DATE DATE)");
this.run("insert into " + versiontbl
Expand Down
Expand Up @@ -66,7 +66,7 @@ private void runSqlInsertScript() throws Exception {
for (String sql : sqls) {
if (sql.startsWith("CALL")) {
String formattedSP = "{" + sql + "}";
this.runOracleStoreProcedure(formattedSP);
this.run(formattedSP);
continue;
}
this.run(sql);
Expand All @@ -78,7 +78,7 @@ private void runSqlInsertScript() throws Exception {
// these private helper class might be useful in the future. feel free to change its access
// modifier
private void setDataVersion(double version) throws Exception {
this.runOracleStoreProcedure("{CALL DROP_TABLE('" + versiontbl + "')}");
this.run("{CALL DROP_TABLE('" + versiontbl + "')}");
this.run("CREATE TABLE " + versiontbl + " (" + "NAME VARCHAR2(100 BYTE) NOT NULL, "
+ "VERSION NUMBER(25,2)," + "INSERT_DATE DATE)");
this.run("insert into " + versiontbl
Expand Down
Expand Up @@ -171,18 +171,6 @@ public CachedRowSetImpl runWithResult(String sql) throws Exception {
}

}

public void runOracleStoreProcedure(String sql) throws Exception {
Connection conn = getConnection();
CallableStatement cs = null;
try {
cs = conn.prepareCall(sql);
cs.execute();
} finally {
cs.close();
conn.close();
}
}

public void run(String input, boolean replaceNewLine) throws Exception {
if (replaceNewLine) {
Expand Down

0 comments on commit 4898d51

Please sign in to comment.