I'm happy to make this public in the current development version of
dbutils. This is partly because I believe any unreleased software has the
right to go and utterly change it in the future, so the users are
accepting that risk [not as if forking a private version of dbutils is
going to be stunningly painful to manage if need be]. [ie, no backwards
compatibility worries until a first alpha, and even then not major worries
until the 1.0 release].
What do you think Juozas?
Additionally, my vote is for having the Connection parameter at the front
there and not hidden in thread locals. It complicates things I think to do
otherwise.
Hen
On 21 Feb 2003, george stewart wrote:
> Hi,
>
> Could the developers elaborate on reasons for having package access to the interface
> ResultSetHandler?
>
> If this was public, user's could create objects without using the object arrays.
> If it ever becomes public, it would be nice to have something like this in the
> package:
>
>
> static void executeQuery(Connection connection, String query,
> Object[] vals, ResultSetHandler rsh,
> Collection cln
> ) throws SQLException
> {
>
> PreparedStatement stmt = null;
> ResultSet rs = null;
>
> try {
>
> stmt = connection.prepareStatement(query);
> fillStatement(stmt, vals);
>
> try{
> rs = stmt.executeQuery();
> while (rs.next()) {
> cln.add(rsh.handle(rs));
> }
>
> }catch(SQLException sqle){
> String msg = sqle.getMessage() + " in query " + query +
> java.util.Arrays.asList(vals).toString();
> SQLException e = new SQLException(msg);
> e.setNextException(sqle);
> throw e;
> }
>
> } finally {
> closeQuietly(rs);
> closeQuietly(stmt);
> }
>
> }
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]