/** @return {@code true} If next row was fetched successfully. */ private boolean fetchNext() { if (data == null) return false; try { if (!data.next()) return false; for (int c = 0; c < row.length; c++) row[c] = data.getObject(c + 1); return true; } catch (SQLException e) { throw new IgniteException(e); } }
/** * @param data Data array. * @throws IgniteCheckedException If failed. */ protected GridH2ResultSetIterator(ResultSet data) throws IgniteCheckedException { this.data = data; if (data != null) { try { row = new Object[data.getMetaData().getColumnCount()]; } catch (SQLException e) { throw new IgniteCheckedException(e); } } else row = null; }
/** {@inheritDoc} */ @Override public void onClose() throws IgniteCheckedException { if (data == null) // Nothing to close. return; try { U.closeQuiet(data.getStatement()); } catch (SQLException e) { throw new IgniteCheckedException(e); } U.closeQuiet(data); }