Permalink
Browse files

Replace question marks only in PreparedStatements

Question marks in the query text should be replaced with positional
parameters ($1, $2, ...) only in java.sql.PreparedStatement.
In a java.sql.Statement they should be left alone.
  • Loading branch information...
Laurenz Albe
Laurenz Albe committed Nov 18, 2015
1 parent fad7f52 commit 3d30a4c76b44ed43a5e5f9460dae16d9efdfc527
Showing with 3 additions and 0 deletions.
  1. +3 −0 org/postgresql/core/Parser.java
@@ -83,6 +83,9 @@
break;
case '?':
if (!withParameters)
break;
nativeSql.append(aChars, fragmentStart, i - fragmentStart);
if (i + 1 < aChars.length && aChars[i + 1] == '?') /* replace ?? with ? */
{

0 comments on commit 3d30a4c

Please sign in to comment.