Replies: 3 comments 7 replies
-
I've read the code and I don't think it matters if it's a PreparedStatement or not, we will honour setEscapeProcessing. |
Beta Was this translation helpful? Give feedback.
-
interesting, I will have a look |
Beta Was this translation helpful? Give feedback.
-
So looking at the Connection and DataSource docs there is no mention of any property for |
Beta Was this translation helpful? Give feedback.
-
The standard, section 13.4, defines JDBC escape syntax, such as
{fn ...}
. Processing of such sequences can be disabled for regularjava.sql.Statement
viasetEscapeProcessing()
method, however there is no way to disable this forjava.sql.PreparedStatement
.This is consistent with the text of the standard, "... setEscapeProcessing method does not work for a PreparedStatement object because its SQL string may have been precompiled when the PreparedStatement object was created."
However, the JavaDoc of the
setEscapeProcessing()
method mentions this: "The Connection and DataSource property escapeProcessing may be used to change the default escape processing behavior." Yet, after exploring the driver's source code, I am quite certain that no such property is currently supported.My questions are:
PreparedStatement
without escape syntax parsing?Let me add a bit of rationale: a weird service that I am supporting synthesizes multi-megabyte SQL queries. When the escape processing is enabled, regardless of the fact that there are no escape sequences, the driver allocates extra buffer and practically copies the original query there, leading to 2x memory consumption and suboptimal performance.
Beta Was this translation helpful? Give feedback.
All reactions