Mercurial > hg > monetdb-java
diff src/main/java/org/monetdb/jdbc/MonetConnection.java @ 425:95d15f1d750d
Restructured code (incl removal of duplicate code) for utility functions dq() and sq() which add double or double quotes and add escapes to string values.
author | Martin van Dinther <martin.van.dinther@monetdbsolutions.com> |
---|---|
date | Wed, 03 Feb 2021 17:22:03 +0100 (2021-02-03) |
parents | de2ef68b672f |
children | 0b808a4d4f1f |
line wrap: on
line diff
--- a/src/main/java/org/monetdb/jdbc/MonetConnection.java +++ b/src/main/java/org/monetdb/jdbc/MonetConnection.java @@ -1729,22 +1729,6 @@ public class MonetConnection return sb.toString(); } - /** - * Utility method to escape all ocurrences of special characters - * (double slashes and single quotes) in a string literal - * It is called from: MonetDatabaseMetaData and MonetPreparedStatement - */ - final String escapeSpecialChars(final String in) { - String ret = in; - if (ret.contains("\\\\")) - // all double slashes in input need to be escaped. - ret = ret.replaceAll("\\\\", "\\\\\\\\"); - if (ret.contains("'")) - // all single quotes in input need to be escaped. - ret = ret.replaceAll("'", "\\\\'"); - return ret; - } - // Internal caches for 3 static mserver environment values, so they aren't queried from mserver again and again private String env_current_user;