Commit 35ed5674 authored by petzka's avatar petzka

Using Statement instead of PreparedStatement

parent f06ab4b3
...@@ -27,6 +27,7 @@ import java.sql.Connection; ...@@ -27,6 +27,7 @@ import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Statement;
import java.util.Arrays; import java.util.Arrays;
import org.jivesoftware.database.bugfix.OF33; import org.jivesoftware.database.bugfix.OF33;
...@@ -367,14 +368,19 @@ public class SchemaManager { ...@@ -367,14 +368,19 @@ public class SchemaManager {
DbConnectionManager.getDatabaseType() == DbConnectionManager.DatabaseType.db2) { DbConnectionManager.getDatabaseType() == DbConnectionManager.DatabaseType.db2) {
command.deleteCharAt(command.length() - 1); command.deleteCharAt(command.length() - 1);
} }
PreparedStatement pstmt = null; /*
* PreparedStatements are not useful at this Point, because no parameters are set. They also prevent the
* creation of trigger in orcale, so use simple statements
* (see http://docs.oracle.com/cd/E11882_01/java.112/e16548/oraint.htm#CHDIIDBE)
*/
Statement stmt = null;
try { try {
String cmdString = command.toString(); String cmdString = command.toString();
if (autoreplace) { if (autoreplace) {
cmdString = cmdString.replaceAll("jiveVersion", "ofVersion"); cmdString = cmdString.replaceAll("jiveVersion", "ofVersion");
} }
pstmt = con.prepareStatement(cmdString); stmt = con.createStatement();
pstmt.execute(); stmt.execute(cmdString);
} }
catch (SQLException e) { catch (SQLException e) {
// Lets show what failed // Lets show what failed
...@@ -382,7 +388,7 @@ public class SchemaManager { ...@@ -382,7 +388,7 @@ public class SchemaManager {
throw e; throw e;
} }
finally { finally {
DbConnectionManager.closeStatement(pstmt); DbConnectionManager.closeStatement(stmt);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment