Example usage for javax.sql RowSet getObject

List of usage examples for javax.sql RowSet getObject

Introduction

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

Prototype

Object getObject(int columnIndex) throws SQLException;

Source Link

Document

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

Usage

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

public boolean evaluate(RowSet rs) {

    if (rs == null)
        return false;

    try {//from ww  w  .ja v  a 2  s.  co m
        for (int i = 0; i < this.cities.length; i++) {

            String cityName = null;

            if (this.colNumber > 0) {
                cityName = (String) rs.getObject(this.colNumber);
            } else if (this.colName != null) {
                cityName = (String) rs.getObject(this.colName);
            } else {
                return false;
            }

            if (cityName.equalsIgnoreCase(cities[i])) {
                return true;
            }
        }
    } catch (SQLException e) {
        return false;
    }
    return false;
}