ResultSet Type

In this chapter you will learn:

  1. How to work with three types of ResultSet

Type of ResultSet

There are three types of ResultSet.

Type Description
ResultSet.TYPE_FORWARD_ONLY The cursor can only move forward.
ResultSet.TYPE_SCROLL_INSENSITIVE The cursor can move forwards and backwards, and the result set is not sensitive to changes made by others after the result set was created.
ResultSet.TYPE_SCROLL_SENSITIVE.The cursor can move forwards and backwards, and the result set is sensitive to changes made by others after the result set was created.

If you do not specify any ResultSet type, the default is TYPE_FORWARD_ONLY.

Next chapter...

What you will learn in the next chapter:

  1. Deal with ResultSet Concurrency
Home » Java Tutorial » Statements, ResultSet, Exception, Warning

Statement

    Three types of statements
    Statement interface
    Insert
    Delete records
    Drop a table
    Batch operation

PreparedStatement

    PreparedStatement
    Insert
    Delete
    Update with parameters
    Batch operation
    ParameterMetaData
    Fetch size
    Set null vaue

CallableStatement

    CallableStatement

ResultSet

    ResultSet
    ResultSet Type
    ResultSet Concurrency
    Create a ResultSet
    ResultSet reading
    ResultSet get by column name
    ResultSet get column by index
    ResultSet next row
    ResultSet table row count
    ResultSet navigation
    ResultSet cursor forward and backward
    ResultSet first
    ResultSet last
    ResultSet after last
    ResultSet before first
    ResultSet absolute(2)
    ResultSet absolute(-1)
    ResultSet relative(-2)
    ResultSet relative(-2)
    ResultSet update
    Column Names
    Column count
    Column Characteristics

ResultSetMetaData

    Column Names
    Column count
    Column Characteristics

SQL Exception, SQL Warning

    SQL Exception
    SQLException information
    Chaining SQLExceptions
    Connection Warning
    PreparedStatement SQLWarning
    Statement SQLWarning
    ResultSet warning
    SQLWarning information