为什么我在文件资源管理器中看不到SQLite Manager的数据库结构

时间:2011-12-12 06:39:27

标签: android eclipse sqlite

为什么我在Eclipse的文件浏览器中看不到SQLite Manager的数据库结构? 当我在文件浏览器中单击我的数据库时,SQLite管理器按钮被禁用 我必须先从Eclipse中取出一个DB,然后使用SQLite数据库浏览器打开它。

这是我的创建数据库代码:

private static final String DB_NAME = "uniDB_";
private static final String Memo_Table = "Memo";
private static final String Memo_ID = "_ID";
private static final String Memo_Name = "MemoName"; 
private static final String Memo_PW = "MemoPW";
private static final String Main_Type = "MainType";
private static final String Sec_Type = "SecType"; 
private static final String Main_ID = "MainID";
private static final String Sec_ID = "SecID";

private static final String Text_Table = "Txt";
private static final String Text_Name =  "TxtMemoName"; 
private static final String Pic_Table = "Pic";
private static final String Pic_Name = "PicMemoName";   
private static final String MemoDB_CREATE = "Create table Memo (_ID INTEGER PRIMARY KEY AUTOINCREMENT, MemoName TEXT, MemoPW TEXT, MainType TEXT, SecType TEXT, MainID TEXT, SecID TEXT)";
private static final String PicDB_CREATE = "Create table Pic (_ID INTEGER PRIMARY KEY AUTOINCREMENT, PicMemoName TEXT)";
private static final String TxtDB_CREATE = "Create table Txt (_ID INTEGER PRIMARY KEY AUTOINCREMENT, TxtMemoName TEXT)";

...

private static class DatabaseHelper extends SQLiteOpenHelper {
    public DatabaseHelper(Context context) {
        super(context, DB_NAME, null , 1); //call constructor's superclass      
        // TODO Auto-generated constructor stub
    }

    ...

    public void onCreate(SQLiteDatabase db) {
        // TODO Auto-generated method stub
        db.execSQL(MemoDB_CREATE);
        db.execSQL(PicDB_CREATE);
        db.execSQL(TxtDB_CREATE);
    }
}

非常感谢您的帮助

1 个答案:

答案 0 :(得分:3)

作为你的代码,我看不到数据库的扩展名,所以首先给出数据库的扩展名

要查看数据库的结构和数据,必须为SQLite Manager安装插件 你可以从here

获取插件

如果您想了解更多信息,请参阅this

如果已安装插件,则必须进行以下更改 可能是您的数据库扩展名为“.sqlite”,如果是,则使用“.db”

进行更改