--返回UTC時間select CURRENT_TIMESTAMP;--返回本地時間select datetime(CURRENT_TIMESTAMP,'localtime');--時間轉換,時間轉換時要求: yyyy-MM-dd,例如: 2008-08-09SELECT datetime('2008-12-22') AS [My Time];SELECT datetime('2008-12-22') AS "My Time";--必須為雙引號SELECT date('now',
安裝.net v3.5SQLiteConnection cn = new SQLiteConnection( "Data Source=test.db;Pooling=true;FailIfMissing=false") pooling default value is trueFailIfMissing default value is falseCREATE TABLE test (id integer primary key, text varchar(10))id will
~~~~~~~~~~SDK之ContentProvider學習筆記~~~~~~~~~~~ ContentProvider的作用如下: Content providers store and retrieve data and make it accessible to all applications. They're the only way to share data across applications; there's no common storage area that all
最近開始學習安卓編程,自己寫一個小項目。有個需求是從一個檔案中初始化一個sqlite資料庫。就是我有一個含有很多SQL語句的檔案,我希望我的安卓程式第一次啟動時,執行這個sql,初始化資料庫,但在以後的執行中,不在執行這個sql,可以說是一個非常典型的引用。google了一下,有關這項任務的實現的是是這篇文章“:Using your own SQLite database in Android applications:http://www.reigndesign.com/blog/using-
因為前面提到xml儲存變更檔很麻煩的緣故,最終還是選擇了使用資料庫儲存一試才覺十分的方便,速度也快上源碼:public class DBHelper extends SQLiteOpenHelper{ private final static String DATABASE_NAME="fanliao_db"; private final static int DATABASE_VERSION=1; private final static String
Ubuntu發行版已經為我們提供了sqlite軟體包,用aptitude安裝libsqlite3-0、libsqlite3-dev、sqlite3、sqlite3-doc軟體包即可。sqlite3系統提供了C語言API,還提供了CLI介面直接存取資料庫檔案。今天測試時遇到error: sqlite3.h: No such file or directory
public class DBHelper extends SQLiteOpenHelper { /** * 資料庫名稱 */ private static final String DB_NAME="mydb.db"; /** * 資料庫版本 */ private static final int DB_VERSION=1; public DBHelper(Context context, String name,