[JDBC-6] Add hook to allow operations on PreparedStatement prior to query execution Created: 26/May/11 Updated: 10/Aug/11 Resolved: 10/Aug/11
|Reporter:||Sean Corfield||Assignee:||Sean Corfield|
It would be very useful to be able to pass in a function argument to several c.j.j functions that would be called on the PreparedStatement before executing the query, for example, calling setFetchSize(). I'm not sure what the syntax should look like for this...
|Comment by Sean Corfield [ 17/Jul/11 3:36 AM ]|
I've started the work to reorganize the code to better expose the statement object for this sort of manipulation.
|Comment by Sean Corfield [ 17/Jul/11 5:57 PM ]|
Two options under consideration:
I like the latter better but Alan Malloy made the point that the former may still be needed for total control anyway.
I'm leaning toward adding a function to ease creation of PreparedStatement objects to at least provide a clean API and then I'll consider how best to integrate that with the other functions.
|Comment by Sean Corfield [ 17/Jul/11 10:02 PM ]|
Added prepare-statement* to jdbc.internal which takes a connection, a SQL string and a map of options; returns a PreparedStatement. Will expose this in top-level.
with-query-results now allows the first element in the sql-params vector to be either:
Options supported are in the docstring. May add additional post-creation options (beyond fetch-size and max-rows).
|Comment by Sean Corfield [ 10/Aug/11 2:23 AM ]|
Users have verified that being able to specify :fetch-size in with-query-results handles the common use cases for performance.