Example usage for javax.sql RowSet getInt

List of usage examples for javax.sql RowSet getInt

Introduction

In this page you can find the example usage for javax.sql RowSet getInt.

Prototype

int getInt(int columnIndex) throws SQLException;

Source Link

Document

Retrieves the value of the designated column in the current row of this ResultSet object as an int in the Java programming language.

Usage

From source file:Main.java

  static void displayRowSet(RowSet rs) throws SQLException {
  while (rs.next()) {
    System.out.println(rs.getRow() + " - " + rs.getString("col1") + ":" + rs.getInt("col2") + ":"
        + rs.getString("col3"));
  }/*from  w w w  .  ja v a  2 s  .com*/
}

From source file:com.oracle.tutorial.jdbc.JdbcRowSetSample.java

private void outputRowSet(RowSet rs) throws SQLException {
    rs.beforeFirst();//  w  w  w .jav a2  s  .c  om
    while (rs.next()) {
        String coffeeName = rs.getString(1);
        int supplierID = rs.getInt(2);
        float price = rs.getFloat(3);
        int sales = rs.getInt(4);
        int total = rs.getInt(5);
        System.out.println(coffeeName + ", " + supplierID + ", " + price + ", " + sales + ", " + total);

    }
}