/** * Reads the current row from result set and adds it to the list. * * @param resultSet Result set to be read. * @param result List to be appended by new row. * @param metaData JDBC meta data. */ private static void addRowFromResultSet( ResultSet resultSet, List<Row> result, ResultSetMetaData metaData) { try { Row row = new Row(metaData.getColumnCount()); for (int i = 1; i <= metaData.getColumnCount(); ++i) { row.put(metaData.getColumnLabel(i), resultSet.getObject(i)); } result.add(row); } catch (SQLException e) { throw new DatabaseException("Can't add row from the result set.", e); } }