Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

×ö¸ö±ê¼Ç£¬ÔÚAndroidÖÐʹÓÃÍøÂçÏÂÔصÄsqliteÎļþ

ÏȼÇÏÂÀ´£º
FileOutputStream outputStream = openFileOutput("mydb", 0);
InputStream inputStream = response.getEntity().getContent();
byte[] data = new byte[bufferSize];
for (int i = inputStream.read(data); i > 0; i = inputStream
        .read(data)) {
    outputStream.write(data, 0, i);
}
SQLiteDatabase database = SQLiteDatabase
        .openOrCreateDatabase(getFileStreamPath(fileName)
                .getAbsolutePath(), null);
Cursor cursor = database.rawQuery("select * from users",
        new String[] {});
if (cursor.moveToFirst()) {
    Log.i(TAG, "user name: " + cursor.getString(1));
}
database.close();


Ïà¹ØÎĵµ£º

SQLite ³õ̽

»¹Êdzõ̽£¬×öµÄÏîÄ¿ÒªÓõ½ÇáÇɵı¾µØÊý¾Ý¿â£¬ÓÚÊÇÕÒÁË sqlite 3 ÊÔÓÃÖ®£¬»¹²»´í£¬¹»ÇáÇÉ¡£
ÉÏÕâ¶ùÈ¥ÏÂÔسÌÐòºÍ²é¿´Îĵµ£º http://www.sqlite.org/download.html
Õâ»Ø¿ª·¢ÓõÄÊÇ C#£¬ÓÚÊÇÕÒÁ˸ö.NETµÄ¿â Finisar.SQLite £¬µ½Õâ¶ùÈ¥ÔØ http://adodotnetsqlite.sourceforge.net/
Òª¼ÇµÄÒ²²»ÊÇʲô´ó²»Á˵Ķ«Î÷£¬Ê¾ÀýÍøÕ¾É϶ ......

SQLite Êý¾Ý¿â¼ÓÃܵÄÒ»ÖÖ½â¾ö·½°¸


sqlite3 *db;
   
sqlite3_stmt *stat;
   
char
*zErrMsg = 0;
   
char
temp[256], FileRoot[256];
   
char
buffer2[1024]="0";
 
   
sprintf(temp, _T("%s"), _T("utf.db")) ......

sqliteÊý¾Ý¿â»ù±¾²Ù×÷

//²åÈë¼°¸üвÙ×÷
 int nRet = 0;
 sqlite3 * db = NULL;
 CString strFilePath;  //Êý¾Ý¿â´æ´¢Â·¾¶
//·¾¶¸³Öµ£¨Ê¡ÂÔ£©
 //Á¬½ÓÊý¾Ý¿â
 nRet = sqlite3_open16(strFilePath, &db);    //Óм¸¸ö´ò¿ªº¯Êý¿É¹©µ÷Óã¬Ê¹ÓÃWCHARÀàÐÍ·¾¶ÓÃÕâ¸ö
 if(nRet != SQLIT ......

Sqlite Êý¾Ý¿â

1¡¢SQLite¼ò½é
¡¡¡¡SQLiteµÚÒ»¸öAlpha°æ±¾µ®ÉúÓÚ2000Äê5ÔÂ. ÖÁ½ñÒѾ­ÓÐ9¸öÄêÍ·ÁË. SQLiteÒ²Ó­À´ÁËÒ»¸ö°æ±¾ SQLite 3ÒѾ­·¢²¼.
¡¡¡¡SQLiteÊÇÒ»¿îÇáÐ͵ÄÊý¾Ý¿â£¬ÊÇ×ñÊØACIDµÄ¹ØÁªÊ½Êý¾Ý¿â¹ÜÀíϵͳ£¬ËüµÄÉè¼ÆÄ¿±êÊÇǶÈëʽµÄ£¬¶øÇÒÄ¿Ç°ÒѾ­ÔںܶàǶÈëʽ²úÆ·ÖÐʹÓÃÁËËü£¬ËüÕ¼ÓÃ×ÊÔ´·Ç³£µÄµÍ£¬ÔÚǶÈëʽÉ豸ÖУ¬¿ÉÄÜÖ»ÐèÒª¼¸°ÙKµ ......

SQLite3µÄC±à³Ì

/*=================================
.*  The Standard include file.
.*
.*===============================*/
#include <stdio.h>
#include <stdlib.h>
/*=================================
.*
.*  The extend include file.
.*
.*===============================*/
#include "sqlit ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ