用于Android存储的SQLiteDatbase

电脑杂谈  发布时间:2020-06-17 05:23:01  来源:网络整理

dat文件_数据dat文件如何打开_dat文件是什么文件

SQLiteDatabase方法生成一个文件,每个应用程序最多对应一个文件dat文件,即.db文件.

您可以使用许多第三方工具来打开和查看的内容.

昨晚我尝试了一些工具,例如navicat,sqlite3,sqlitespy等,但仍然认为sqlitespy更易于使用,并且体积很小,仅为1.7M. 文件管理中有一个相应的sqlitespy. 保存后dat文件,到处都可以找到sqlite打开工具.

数据dat文件如何打开_dat文件是什么文件_dat文件

前面的SharedPreferences的存储方法类似于Web应用程序中表单的存储.

除了将Android存储在SQLite中之外,SQLiteDatabase与在Oracle中存储数据类似.

注意:

数据dat文件如何打开_dat文件_dat文件是什么文件

sqlite构建表sql和Oracle在不同的位置:

Oracle:

create table usertb (_id integer primary key autoincrement, name text not null , age integer not null , sex text not null )

dat文件是什么文件_dat文件_数据dat文件如何打开

或

create or replace table usertb (_id integer primary key autoincrement, name text not null , age integer not null , sex text not null )

sqlite:

create table if not exists usertb (_id integer primary key autoincrement, name text not null , age integer not null , sex text not null )

确保添加如果不存在的判断. 已经有一个需要在sqlite中构建的表,并且如果在构建表时不添加不存在的表,则会出现错误,因为您无法重复构建具有相同表名的表.

MainActivity.java如下:


本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/shumachanpin/article-248175-1.html

    相关阅读
      发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

      • 唐寅
        唐寅

        我们的原则是不惹事人怕事

      热点图片
      拼命载入中...