Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » UltraLite - Java Programming » UltraLiteJ application development » Code examples


Java SE example: Reading a table

Run the Java SE sample to understand how to read a table.


There are no prerequisites for this task.

Contexte et remarques

In this example, a PreparedStatement object is obtained from a connection, and a ResultSet object is obtained from the PreparedStatement object. The next method on the ResultSet returns true each time a subsequent row can be obtained. Values for the columns in the current row can then be obtained from the ResultSet object.

  1. Change to the following directory: %SQLANYSAMP16%\UltraLiteJ\J2SE.

  2. Run the CreateDb example:

    rundemo CreateDb
  3. Run the LoadDb example:

    rundemo LoadDb
  4. Run the following command (the command is case sensitive):

    rundemo ReadSeq


The application runs successfully. When a ResultSet is created, it is positioned before the first row of the result set. The ReadSeq application reads and displays result sets sequentially.

 See also