* Special character like $ in the original sql can cause exception in the recoverQuotedString method.

This commit is contained in:
Heng Sin Low 2007-01-19 14:34:46 +00:00
parent f89eee0016
commit d4430f4270
1 changed files with 4 additions and 2 deletions

View File

@ -186,10 +186,12 @@ public class Convert_PostgreSQL extends Convert_SQL92 {
} }
private String recoverQuotedStrings(String retValue, Vector<String>retVars) { private String recoverQuotedStrings(String retValue, Vector<String>retVars) {
Pattern p = Pattern.compile("<-->", REGEX_FLAGS); Pattern p = Pattern.compile("<-->", Pattern.CASE_INSENSITIVE | Pattern.LITERAL);
Matcher m = p.matcher(retValue); Matcher m = p.matcher(retValue);
for (int cont = 0; cont < retVars.size(); cont++) { for (int cont = 0; cont < retVars.size(); cont++) {
retValue = m.replaceFirst((String) retVars.get(cont)); //hengsin, special character in replacement can cause exception
String replacement = (String) retVars.get(cont);
retValue = m.replaceFirst(Matcher.quoteReplacement(replacement));
m = p.matcher(retValue); m = p.matcher(retValue);
} }
return retValue; return retValue;