android資料庫相關幾個小問題

2021-07-07 03:37:33 字數 644 閱讀 5348

不太能理解contentprovider的gettype函式的作用,查到以下內容:

總體來說,就是傳進去乙個uri,返回乙個表示mime型別的字串;裡面還說,如果是單條記錄應該返回以vnd.android.cursor.item/ 為首的字串,如果是多條記錄,應該返回vnd.android.cursor.dir/ 為首的字串;

mime型別在activity中是用來指定,當前的activity所支援開啟的檔案型別。

和intent-filter有關。

不過還是有點模模糊糊。

mbuilder.settables方法在使用的時候發現一點小驚喜:

原始碼解釋及事例:

sets the list of tables to query. multiple tables can be specified to perform a join.

* for example:

*   settables("foo, bar")

*   settables("foo left outer join bar on (foo.id = bar.foo_id)")

** @param intables the list of tables to query on

可以輸入多個表進行查詢。

順便:

資料庫相關

1.操作類 godb public goosundb open throws sqlexception public void close public cursor search int mark mark mark,null,null,null,col date desc if cursor n...

資料庫相關

資料庫的設計 分庫分表,記憶體資料庫,主從讀寫分離,資料庫中介軟體mycat 整合了主從讀寫分離,分庫分表等功能 資料庫優化 sql語句優化,資料庫配置優化,索引優化,資料庫設計優化 資料庫的鎖 1.樂觀鎖,表中增加版本字段,每次更改加1,查的時候先把版本字段查出來,更新的時候加上條件版本欄位沒變,...

資料庫相關

1 多顯示乙個字段,格式 使用者名稱 手機號 select concat name,tel from user 2 手機號顯示 132 22 select concat left tel,3 right tel,2 as 安全手機號 from user 1 多顯示乙個字段,格式 使用者名稱 手機號 ...