与android database 交互(chapter 14-Working with the SQLite Database)
来源:互联网 发布:mysql从零开始学 编辑:程序博客网 时间:2024/05/17 23:54
access数据库的三种方式(数据库通常位于/data/data/<app name>下)
1. adb shell(唯一可直接访问虚机或物理机上的数据库的方式)
在命令行模式使用adb -e shell 进入虚机shell , adb -d shell进入物理机shell(如果只有一个虚机或物理机在运行)或者 adb -s <device name> shell
cd c:\androidsdk\sdk\platform-tools
adb -e shell
sqlite3
然后可运行sqlite3的命令。比如:
.tables
列出所有表格.schema [tablename]
显示表格的创建statement
有关sqlite详细文档参考:http://www.sqlite.org/sqlite.html, section Special commands to sqlite3.
以下两种只能操作本机上的数据库(有UI)
2. eclipse 的JDBC driver
3. sqlite expert personal edition(www.sqliteexpert.com)
辅助的数据库工具:SQLiteAssetHelper class(https://github.com/jgilfelt/android-sqlite-asset-helper) 。该类实例化后会将\assets\databases 目录下的数据库拷贝到应用的私有空间,这样可以免去测试时创建和升级数据库的麻烦
主要类:
SQLiteDatabase - 用于与SQLite数据库直接交互
SQLiteQueryBuilder - 用于创建数据查询语句
SQLiteStatement - 用于执行SQL查询
SQLiteCursor - 用于cursor操作
SQLiteOpenHelper - 用于数据库的打开,创建和升级
- 与android database 交互(chapter 14-Working with the SQLite Database)
- Working with the SQLite-Database - Cursors
- Fundamentals of Working with the Database
- Android SQLite Database with Multiple Tables
- android database SQLite
- Android SQLite Database
- Android SQLite Database Tutorial
- android.database.sqlite
- SQLite android.database.CursorIndexOutOfBoundsException
- Create Android SQLite database
- android.database.sqlite.SQLiteException: database is locked
- Chapter 2:Installing the oracle database software
- android database sqlite的使用
- 【Android数据存储】- SQLite Database
- android.database.sqlite.SQLiteDa…
- [SQLite]---database
- Help with SQLite database and VBScript
- Accessing Local Database SQLite with AIR API
- [LeetCode] Letter Combinations of a Phone Number
- 【Ubuntu】[VIM]:ubuntu下vi不能正常使用的解决方法
- python—xml读写—minidom and etree
- Opengl es2.0 glEnable(GL_TEXTURE_2D)报错 GL_INVALID_ENUM
- Sharepoint2013 Report Service初探
- 与android database 交互(chapter 14-Working with the SQLite Database)
- Spark安装启动 and 在程序中调用spark服务
- linux 查看 进程 端口号
- 树状数组解敌兵布阵
- Hadoop2.2.0的eclipse插件的编译
- Hashtable源码分析
- QUICK_COCOS2DX创建新项目
- Oracle 声明常量
- ntsysv的操作方法