On Jan 7, 10:32 am, Ken Wesson <kwess...@gmail.com> wrote: > On Fri, Jan 7, 2011 at 12:22 AM, Shantanu Kumar > > <kumar.shant...@gmail.com> wrote: > > On Jan 7, 6:49 am, Ken Wesson <kwess...@gmail.com> wrote: > >> I'd hope it has some kind of caching or memoization behind the scenes, > >> but if not, that'd be a great thing to add for version 1.1. I think a > >> typical database client app uses a finite variety of prepared > >> statements (each with potentially changing parameter values), so > >> straight memoization ought to do fine and clojure already natively > >> supports that, so ... > > > The tricky part is - a PreparedStatement object is created and is > > valid only in the context of a Connection object (because statement > > compilation is database specific, and often needs an extra roundtrip > > to the database). > > That's icky. It's not common for one app to use two separate databases > in a single running instance, so the PreparedStatement should really > be valid across connections as long as they're to the same server.
It should be really good if that's true - please let me know the source if you have. However, the JDBC spec doesn't seem to indicate so (I guess that's because Connections can be created with custom parameters to change some runtime attributes): http://download.oracle.com/javase/6/docs/api/java/sql/Connection.html#prepareStatement(java.lang.String) http://www.javaperformancetuning.com/tips/jdbc_prepared.shtml#REF14 http://www.java-blog.com/prepared-statements-jdbc Regards, Shantanu -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en