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: "...it 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. > It is tedious, error-prone, and non-portable to require application > developers to deal with this kind of thing themselves. Hear hear :) Hen -- To unsubscribe, e-mail: <mailto:commons-dev-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:commons-dev-help@;jakarta.apache.org>
