Sebastiaan van Erk wrote:
> This is indeed part of the code I was talking about. And indeed a
> StringBuffer is already a definate improvement.
>
> However, the setString() method will also cause the data to be duplicated
> when escapeString() is called. A version of escapeString() which works
> on a StringBuffer would be another improvement in my opinion, saving
> (if the allocated StringBuffer is made a bit larger to allow for the
> escaping), in most cases another allocation of the whole string.
I would point out again that this is all different in the current
development driver. escapeString() no longer exists, and the V3 protocol
path does not do any additional string escaping as the string is passed
directly as a parameter in a Bind message.
There's still much scope for improvement, but I'd strongly suggest you
use the development driver as a starting point.
-O