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

SQL Anywhere 11.0.1 (中文) » UltraLite - M-Business Anywhere 编程 » 了解 UltraLite for M-Business Anywhere 开发 » 使用 SQL 处理数据

 

使用 SQL 导航

UltraLite for M-Business Anywhere 为您执行各种各样的导航任务提供了许多在结果集中导航的方法。

使用 ResultSet 对象的以下方法,您可以在结果集中导航:

  • moveAfterLast   移至最后一行之后的位置。

  • moveBeforeFirst   移至第一行之前的位置。

  • moveFirst   移至第一行。

  • moveLast   移至最后一行。

  • moveNext   移至下一行。

  • movePrevious   移至上一行。

  • moveRelative   相对于当前行移动一定数量的行。正索引值在结果集中向前移动,负索引值在结果集中向后移动,零不移动游标。如果要重新填充行缓冲区,可以使用零。

示例

以下代码段演示了如何使用 moveFirst 方法在结果集中导航。

PrepStmt = conn.prepareStatement( 
    "SELECT ID, Name FROM customer", null );
MyResultSet = PrepStmt.executeQuery( null );
MyResultSet.moveFirst();

所有的 move 方法都采用这样一种方式。

有关这些导航方法的详细信息,请参见ResultSet 类