protected <R> R openStatement(final Connection db, JdbcCallback<R> callback, Sql sql)
    {
        PreparedStatement stmt = null;
        try
        {
            stmt = db.prepareStatement(sql.toSql());
            return callback.connected(stmt);
        }
        catch (SQLException e) {
            throw new RuntimeException(e);
        }
        finally {
            if(stmt != null)
            {
                try {
                    stmt.close();
                } catch (SQLException e) {
                    //ignore
                }
            }
        }
    }