Mercurial > hg > monetdb-java
diff src/main/java/org/monetdb/jdbc/MonetPreparedStatement.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 | bf9f6b6ecf40 |
children | 3da79315783b |
line wrap: on
line diff
--- a/src/main/java/org/monetdb/jdbc/MonetPreparedStatement.java +++ b/src/main/java/org/monetdb/jdbc/MonetPreparedStatement.java @@ -2019,7 +2019,7 @@ public class MonetPreparedStatement // representation is given, but we need to prefix it // with the actual sqltype the server expects, or we // will get an error back - setValue(paramnr, sqltype + " '" + connection.escapeSpecialChars(x) + "'"); + setValue(paramnr, sqltype + " " + MonetWrapper.sq(x)); } @Override @@ -2293,7 +2293,7 @@ public class MonetPreparedStatement break; } /* in specific cases prefix the string with: inet or json or url or uuid */ - setValue(parameterIndex, castprefix + " '" + connection.escapeSpecialChars(x) + "'"); + setValue(parameterIndex, castprefix + " " + MonetWrapper.sq(x)); break; } @@ -2579,7 +2579,7 @@ public class MonetPreparedStatement return; } - setValue(parameterIndex, "url '" + connection.escapeSpecialChars(x.toString()) + "'"); + setValue(parameterIndex, "url " + MonetWrapper.sq(x.toString())); } /**