Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
8be423d8
Commit
8be423d8
authored
Sep 07, 2017
by
Dave Cridland
Committed by
GitHub
Sep 07, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #858 from cpetzka/ExecuteSQLWithoutPreparedStatements
Using Statement instead of PreparedStatement
parents
85229183
35ed5674
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
SchemaManager.java
src/java/org/jivesoftware/database/SchemaManager.java
+10
-4
No files found.
src/java/org/jivesoftware/database/SchemaManager.java
View file @
8be423d8
...
...
@@ -27,6 +27,7 @@ import java.sql.Connection;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.util.Arrays
;
import
org.jivesoftware.database.bugfix.OF33
;
...
...
@@ -367,14 +368,19 @@ public class SchemaManager {
DbConnectionManager
.
getDatabaseType
()
==
DbConnectionManager
.
DatabaseType
.
db2
)
{
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
{
String
cmdString
=
command
.
toString
();
if
(
autoreplace
)
{
cmdString
=
cmdString
.
replaceAll
(
"jiveVersion"
,
"ofVersion"
);
}
pstmt
=
con
.
prepareStatement
(
cmdString
);
pstmt
.
execute
(
);
stmt
=
con
.
createStatement
(
);
stmt
.
execute
(
cmdString
);
}
catch
(
SQLException
e
)
{
// Lets show what failed
...
...
@@ -382,7 +388,7 @@ public class SchemaManager {
throw
e
;
}
finally
{
DbConnectionManager
.
closeStatement
(
p
stmt
);
DbConnectionManager
.
closeStatement
(
stmt
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment