commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <>
Subject Re: [dbutils] StringUtils proposed methods
Date Mon, 11 Nov 2002 19:06:07 GMT

On Mon, 11 Nov 2002, Craig R. McClanahan wrote:

> In at least a couple of popular open source JDBC drivers (at various
> times -- haven't looked lately), the implementation of the String
> based calls just used the prepared statement logic underneath the
> covers, so the "extra overhead" was zero.  That's probably not true
> for Oracle's driver, though.

>From OReilly's Oracle JDBC book:

" takes about 65 iterations of a prepared statement before its total
time for execution catches up with a statement. "

> The primary reason I encourage people to use prepared statements *all* the
> time is so that the poor user doesn't have to learn things like the quote
> escaping mechanisms (often database specific) so that names like
> "O'Reilly"  can be stored in a text column.  Same thing in spades for all
> of the wierd date conversions that some databases require.

This is the same reason I push the 'java lie to newbies' that they should
use PreparedStatement all the time. No learning about date-syntax for a
particular database, no worrying about escaping.

If all databases now support '' as the escape mechanism properly, then
that's good and we should have it. If there is a standard date-format that
does work, then good.

I guess we could have:

Sql99Utils as a method, so it's obvious that some db's might not support

> It is tedious, error-prone, and non-portable to require application
> developers to deal with this kind of thing themselves.

Hear hear :)


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message