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]

Reply via email to