Determining If a Result Set Is Scrollable - Java JDBC

Java examples for JDBC:ResultSet

Description

Determining If a Result Set Is Scrollable

Demo Code

import java.sql.ResultSet;
import java.sql.SQLException;

public class Main {

  public void main(String[] argv) {
    try {// www  . j a va 2 s. c  o  m
      ResultSet resultSet = null;
      // Get type of the result set
      int type = resultSet.getType();

      if (type == ResultSet.TYPE_SCROLL_INSENSITIVE
          || type == ResultSet.TYPE_SCROLL_SENSITIVE) {
        // Result set is scrollable
      } else {
        // Result set is not scrollable
      }
    } catch (SQLException e) {
    }
  }
}

Related Tutorials