sqlitestudio中文版下載 最新更新|軟件分類|軟件專題|手機版|論壇轉(zhuǎn)貼|軟件發(fā)布

您當前所在位置:首頁編程開發(fā)數(shù)據(jù)庫類 → sqlite可視化工具(SqliteStudio) v3.3.3 綠色漢化版

sqlite可視化工具(SqliteStudio)

v3.3.3 綠色漢化版

sqlite可視化工具(SqliteStudio)
  • 軟件大小:4.3M
  • 軟件語言:中文
  • 軟件類型:國產(chǎn)軟件 / 數(shù)據(jù)庫類
  • 軟件授權(quán):免費軟件
  • 更新時間:2022-02-28 14:42
  • 軟件等級:4星
  • 應(yīng)用平臺:WinAll, WinXP
  • 軟件官網(wǎng):

ITMOP本地下載文件大。4.3M

點贊好評0%(0) 差評差評0%(0)

軟件介紹人氣軟件精品推薦相關(guān)文章網(wǎng)友評論下載地址

小編為您推薦:SqliteStudiosqlite可視化

sqliteStudio中文版是一款 Sqlite數(shù)據(jù)庫可視化工具,是使用Sqlite數(shù)據(jù)庫開發(fā)應(yīng)用的必備軟件,軟件無需安裝,下載后解壓即可使用,很小巧但很了用,綠色中文版本。比起其它SQLite管理工具,我喜歡用這個。很方便易用,不用安裝的單個可執(zhí)行文件,支持中文。歡迎來到IT貓撲網(wǎng)下載!

SqliteStudio介紹

SQLiteStudio 是一個跨平臺的 SQLite 數(shù)據(jù)庫的管理工具,采用 Tcl 語言開發(fā)。

SQLiteStudio的特色

功能完善的sqlite2和sqlite3工具,視圖編碼支持utf8。

支持導(dǎo)出數(shù)據(jù)格式:csv、html、plain、sql、xml,

可同時打開多個數(shù)據(jù)庫文件

支持查看和編輯二進制字段

使用方法

選擇數(shù)據(jù)庫--->添加數(shù)據(jù)庫--->選擇你的本地數(shù)據(jù)庫,并點擊+增加就可以查看數(shù)據(jù)庫了。

SqliteStudio

SqliteStudio

SqliteStudio在Android程序中使用已有的SQLite數(shù)據(jù)庫

1. 準備SQLite database文件

假設(shè)你已經(jīng)創(chuàng)建了一個sqlite數(shù)據(jù)庫,我們需要對其進行一些修改。

(譯者注:這里原文是推薦了一個SQLite數(shù)據(jù)庫管理軟件,這個我覺得可以隨自己的喜好,最Windows下面有多款可視化的SQlite數(shù)據(jù)庫管理軟件,可以方便的讀取,編輯數(shù)據(jù)庫,例如我用的是sqlitestudio

打開數(shù)據(jù)庫,添加一個新的table “android_metadata",插入一行數(shù)據(jù),具體的SQL如下:

[sql] view plaincopyprint?在CODE上查看代碼片派生到我的代碼片

CREATE TABLE "android_metadata" ("locale" TEXT DEFAULT 'en_US')

INSERT INTO "android_metadata" VALUES ('en_US')

(譯者注:上面兩行是表明需要進行的操作,具體可以直接在sqlitesstudio中完成)

然后你需要對你數(shù)據(jù)表格的primary id 列重命名為 “_id”,這樣Adroid會知道怎么對id列進行綁定,你可以很容易的在SQlite數(shù)據(jù)庫管理軟件中進行列編輯。

這兩步之后,你的sqlite數(shù)據(jù)庫文件就準備好了。

(譯者注:這里我保留了id列,即沒有對其進行重命名,測試證明也是沒有問題的)

2. 在你的Android程序中復(fù)制,打開以及訪問數(shù)據(jù)庫

現(xiàn)在把你上一步準備好的數(shù)據(jù)庫文件放在“assets”文件夾下面,然后通過繼承 SQLiteOpenHelper類來創(chuàng)建一個Database Helper類,

你的DataBaseHelper類大致可以如下:

public class DataBaseHelper extends SQLiteOpenHelper{

//The Android's default system path of your application database.

private static String DB_PATH = "/data/data/YOUR_PACKAGE/databases/";

private static String DB_NAME = "myDBName";

private SQLiteDatabase myDataBase;

private final Context myContext;

/**

* Constructor

* Takes and keeps a reference of the passed context in order to access to the application assets and resources.

* @param context

*/

public DataBaseHelper(Context context) {

super(context, DB_NAME, null, 1);

this.myContext = context;

}

/**

* Creates a empty database on the system and rewrites it with your own database.

* */

public void createDataBase() throws IOException{

boolean dbExist = checkDataBase();

if(dbExist){

//do nothing - database already exist

}else{

//By calling this method and empty database will be created into the default system path

//of your application so we are gonna be able to overwrite that database with our database.

this.getReadableDatabase();

try {

copyDataBase();

} catch (IOException e) {

throw new Error("Error copying database");

}

}

}

/**

* Check if the database already exist to avoid re-copying the file each time you open the application.

* @return true if it exists, false if it doesn't

*/

private boolean checkDataBase(){

SQLiteDatabase checkDB = null;

try{

String myPath = DB_PATH + DB_NAME;

checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);

}catch(SQLiteException e){

//database does't exist yet.

}

if(checkDB != null){

checkDB.close();

}

return checkDB != null ? true : false;

}

/**

* Copies your database from your local assets-folder to the just created empty database in the

* system folder, from where it can be accessed and handled.

* This is done by transfering bytestream.

* */

private void copyDataBase() throws IOException{

//Open your local db as the input stream

InputStream myInput = myContext.getAssets().open(DB_NAME);

// Path to the just created empty db

String outFileName = DB_PATH + DB_NAME;

//Open the empty db as the output stream

OutputStream myOutput = new FileOutputStream(outFileName);

//transfer bytes from the inputfile to the outputfile

byte[] buffer = new byte[1024];

int length;

while ((length = myInput.read(buffer))>0){

myOutput.write(buffer, 0, length);

}

//Close the streams

myOutput.flush();

myOutput.close();

myInput.close();

}

public void openDataBase() throws SQLException{

//Open the database

String myPath = DB_PATH + DB_NAME;

myDataBase = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);

}

@Override

public synchronized void close() {

if(myDataBase != null)

myDataBase.close();

super.close();

}

@Override

public void onCreate(SQLiteDatabase db) {

}

@Override

public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

}

// Add your public helper methods to access and get content from the database.

// You could return cursors by doing "return myDataBase.query(....)" so it'd be easy

// to you to create adapters for your views.

}

就這樣。

現(xiàn)在你可以創(chuàng)建一個新的DataBaseHelper實例,然后調(diào)用createDataBase(),然后再調(diào)用openDataBase()方法,記住修改DB_PATH字符串中“YOUR_PACKAGE”為你真正的package名稱(也就是說com.examplename.myapp)

以下是示范代碼:

[java] view plaincopyprint?在CODE上查看代碼片派生到我的代碼片

...

DataBaseHelper myDbHelper = new DataBaseHelper();

myDbHelper = new DataBaseHelper(this);

try {

myDbHelper.createDataBase();

} catch (IOException ioe) {

throw new Error("Unable to create database");

}

try {

myDbHelper.openDataBase();

}catch(SQLException sqle){

throw sqle;

}

...

更多>>軟件截圖

推薦軟件

其他版本下載

    精品推薦sqlite

    sqlite
    更多 (33個) >>sqlitesqlite專題是小編精選給大家的數(shù)據(jù)庫管理工具,可能有朋友不知道sqlite的作用,它是款遵守ACID的關(guān)系型數(shù)據(jù)庫管理系統(tǒng)。在編程開發(fā)上能夠那起著很大的作用!它幾乎支持所有電腦操作系統(tǒng),完美兼容,不用擔心系統(tǒng)的配

    相關(guān)文章

      下載地址

      • sqlite可視化工具(SqliteStudio) v3.3.3 綠色漢化版

      查看所有評論>>網(wǎng)友評論

      發(fā)表評論

      (您的評論需要經(jīng)過審核才能顯示) 網(wǎng)友粉絲QQ群號:203046401

      查看所有0條評論>>

      更多>>猜你喜歡