0

the code like this:

Screenshot 1

the exception like this:

java.sql.SQLFeatureNotSupportedException at com.salesforce.phoenix.jdbc.PhoenixResultSet.first(PhoenixResultSet.java:173)

Johnny Bones
  • 8,786
  • 7
  • 52
  • 117
WholeStack
  • 23
  • 8
  • 2
    Please include the code in the question **as text**. Don't post screenshots of code. As to the problem: have you read the JDBC API Javadoc of [`ResultSet.first()`](http://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#first--), especially _"SQLFeatureNotSupportedException - if the JDBC driver does not support this method"_? Apparently your driver doesn't support this, also note that unless you use scrollable result sets (which your code doesn't, and the driver likely doesn't support), that `first()` is supposed to throw an SQLException anyway. – Mark Rotteveel Jan 27 '16 at 12:15

2 Answers2

3

If you recode your code to use next() instead of first() you'll be fine:

while(resultset.next()) {
  //Do something with resultset
}

If you're looking for the why though... you'll have to go and ask the developers of that JDBC driver. As positioning inside a ResultSet requires a scrollable ResultSet, it is possible that this feature simply is not there.

Jan
  • 13,738
  • 3
  • 30
  • 55
1

The implementation for ResultSet.first() is not yet done in Apache Phenix. Hence, you get the error.

 public boolean first() throws SQLException {
        throw new SQLFeatureNotSupportedException();
    }

Try using ResultSet.next() function.

Bala
  • 11
  • 1