protected static GroovyResultSet getImpl(CallableStatement call, int idx) { GroovyResultSetProxy proxy = new GroovyResultSetProxy(new CallResultSet(call, idx)); return proxy.getImpl(); } }
protected static GroovyResultSet getImpl(CallableStatement call, int idx) { GroovyResultSetProxy proxy = new GroovyResultSetProxy(new CallResultSet(call, idx)); return proxy.getImpl(); } }
protected static GroovyResultSet getImpl(CallableStatement call, int idx) { GroovyResultSetProxy proxy = new GroovyResultSetProxy(new CallResultSet(call,idx)); return proxy.getImpl(); } }
protected static GroovyResultSet getImpl(CallableStatement call, int idx) { GroovyResultSetProxy proxy = new GroovyResultSetProxy(new CallResultSet(call, idx)); return proxy.getImpl(); } }
/** * Overridden to fix passing the resultset to the closure */ @Override public void eachRow(String sql, Closure metaClosure, Closure rowClosure) throws SQLException { AbstractQueryCommand command = createQueryCommand(sql); ResultSet results = null; try { results = command.execute(); if (metaClosure != null) metaClosure.call(results.getMetaData()); GroovyResultSet groovyRS = new GroovyResultSetProxy(results).getImpl(); while (groovyRS.next()) { rowClosure.call(groovyRS); } } catch (SQLException e) { LOG.warning("Failed to execute: " + sql + " because: " + e.getMessage()); throw e; } finally { command.closeResources(); } }
protected static GroovyResultSet getImpl(CallableStatement call, int idx) { GroovyResultSetProxy proxy = new GroovyResultSetProxy(new CallResultSet(call,idx)); return proxy.getImpl(); } }
protected static GroovyResultSet getImpl(CallableStatement call, int idx) { GroovyResultSetProxy proxy = new GroovyResultSetProxy(new CallResultSet(call,idx)); return proxy.getImpl(); } }
Object o = statement.getObject(indx + 1); if (o instanceof ResultSet) { results.add(new GroovyResultSetProxy((ResultSet) o).getImpl()); } else { results.add(o);
Object o = statement.getObject(indx + 1); if (o instanceof ResultSet) { results.add(new GroovyResultSetProxy((ResultSet) o).getImpl()); } else { results.add(o);
/** * Performs the given SQL query calling closures for metadata and each row * * @param sql the sql statement * @param metaClosure called for meta data (only once after sql execution) * @param rowClosure called for each row with a GroovyResultSet * @throws SQLException if a database access error occurs */ public void eachRow(String sql, Closure metaClosure, Closure rowClosure) throws SQLException { Connection connection = createConnection(); Statement statement = createConnection(connection); configure(statement); ResultSet results = null; try { log.fine(sql); results = statement.executeQuery(sql); if (metaClosure != null) metaClosure.call(results.getMetaData()); GroovyResultSet groovyRS = new GroovyResultSetProxy(results).getImpl(); while (groovyRS.next()) { rowClosure.call(groovyRS); } } catch (SQLException e) { log.log(Level.FINE, "Failed to execute: " + sql, e); throw e; } finally { closeResources(connection, statement, results); } }
/** * Performs the given SQL query calling closures for metadata and each row * * @param sql the sql statement * @param metaClosure called for meta data (only once after sql execution) * @param rowClosure called for each row with a GroovyResultSet * @throws SQLException if a database access error occurs */ public void eachRow(String sql, Closure metaClosure, Closure rowClosure) throws SQLException { Connection connection = createConnection(); Statement statement = getStatement(connection, sql); configure(statement); ResultSet results = null; try { log.fine(sql); results = statement.executeQuery(sql); if (metaClosure != null) metaClosure.call(results.getMetaData()); GroovyResultSet groovyRS = new GroovyResultSetProxy(results).getImpl(); while (groovyRS.next()) { rowClosure.call(groovyRS); } } catch (SQLException e) { log.log(Level.FINE, "Failed to execute: " + sql, e); throw e; } finally { closeResources(connection, statement, results); } }
results = statement.executeQuery(); GroovyResultSet groovyRS = new GroovyResultSetProxy(results).getImpl(); while (groovyRS.next()) { closure.call(groovyRS);
GroovyResultSet groovyRS = new GroovyResultSetProxy(results).getImpl(); while (groovyRS.next()) { closure.call(groovyRS);
GroovyResultSet groovyRS = new GroovyResultSetProxy(results).getImpl(); groovyRS.eachRow(rowClosure); } catch (SQLException e) {
if (!cursorAtRow) return; GroovyResultSet groovyRS = new GroovyResultSetProxy(results).getImpl(); int i = 0; while (groovyRS.next() && (maxRows <= 0 || i++ < maxRows)) {
if (!cursorAtRow) return; GroovyResultSet groovyRS = new GroovyResultSetProxy(results).getImpl(); int i = 0; while (groovyRS.next() && (maxRows <= 0 || i++ < maxRows)) {
results = statement.executeQuery(); GroovyResultSet groovyRS = new GroovyResultSetProxy(results).getImpl(); while (groovyRS.next()) { closure.call(groovyRS);
Object o = statement.getObject(indx + 1); if (o instanceof ResultSet) { GroovyResultSet resultSet = new GroovyResultSetProxy((ResultSet) o).getImpl(); results.add(resultSet); resultSetResources.add(resultSet);
if (!cursorAtRow) return; GroovyResultSet groovyRS = new GroovyResultSetProxy(results).getImpl(); int i = 0; while ((maxRows <= 0 || i++ < maxRows) && groovyRS.next()) {
if (!cursorAtRow) return; GroovyResultSet groovyRS = new GroovyResultSetProxy(results).getImpl(); int i = 0; while ((maxRows <= 0 || i++ < maxRows) && groovyRS.next()) {