zoukankan      html  css  js  c++  java
  • android sql Cursor

    Cursor 是每行的集合。

    使用 moveToFirst() 定位第一行。 你必须知道每一列的名称。你必须知道每一列的数据类型。Cursor 是一个随机的数据源。
    所有的数据都是通过下标取得。

    Cursor所指向的就是每一条数据。

    方法:

    close() 关闭游标,释放资源

    getColumnCount() 返回所有列的总数

    getColumnIndex(String columnName) 返回指定列的名称,如果不存在返回-1

    getColumnIndexOrThrow(String columnName) 从零开始返回指定列名称,如果不存在将抛出IllegalArgumentException 异常。

    getColumnName(int columnIndex) 从给定的索引返回列名

    getColumnNames() 返回一个字符串数组的列名

    getCount() 返回Cursor 中的行数

    moveToFirst() 移动光标到第一行

    moveToLast() 移动光标到最后一行 ,返回值是boolean是指:下标是否成功移动到最后一行

    moveToNext() 移动光标到下一行

    moveToPosition(int position) 移动光标到一个绝对的位置

    moveToPrevious() 移动光标到上一行

  • 相关阅读:
    记素质拓展
    操场边的人
    ASP.NET MVC FileResult介绍
    SQL SERVER 数据类型详解
    ASP.NET 使用Response.WriteFile方法下载文件
    Java 静态代理和动态代理
    单例模式
    设计模式六原则
    Python 单例模式
    JAVA WEB 中涉及的编解码
  • 原文地址:https://www.cnblogs.com/yujian-bcq/p/3503884.html
Copyright © 2011-2022 走看看