class DBQueries {

    public static java.sql.ResultSet getAllIndexEntries(final String tableName, final Connection connection){
        final String selectSql = String.format("SELECT objectKey, value FROM cqtbl_%s ORDER BY objectKey;",tableName);
        Statement statement = null;
        try{
            statement = connection.createStatement();
            return statement.executeQuery(selectSql);
        }catch(Exception e){
            DBUtils.closeQuietly(statement);
            throw new IllegalStateException("Unable to look up index entries.", e);
        }
        // In case of success we leave the statement and result-set open because the iteration of an Index ResultSet is lazy.

    }

}