×ö¸ö±ê¼Ç£¬ÔÚ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();
Ïà¹ØÎĵµ£º
»¹Êdzõ̽£¬×öµÄÏîÄ¿ÒªÓõ½ÇáÇɵı¾µØÊý¾Ý¿â£¬ÓÚÊÇÕÒÁË sqlite 3 ÊÔÓÃÖ®£¬»¹²»´í£¬¹»ÇáÇÉ¡£
ÉÏÕâ¶ùÈ¥ÏÂÔسÌÐòºÍ²é¿´Îĵµ£º http://www.sqlite.org/download.html
Õâ»Ø¿ª·¢ÓõÄÊÇ C#£¬ÓÚÊÇÕÒÁ˸ö.NETµÄ¿â Finisar.SQLite £¬µ½Õâ¶ùÈ¥ÔØ http://adodotnetsqlite.sourceforge.net/
Òª¼ÇµÄÒ²²»ÊÇʲô´ó²»Á˵Ķ«Î÷£¬Ê¾ÀýÍøÕ¾É϶ ......
sqlite3 *db;
sqlite3_stmt *stat;
char
*zErrMsg = 0;
char
temp[256], FileRoot[256];
char
buffer2[1024]="0";
sprintf(temp, _T("%s"), _T("utf.db")) ......
//²åÈë¼°¸üвÙ×÷
int nRet = 0;
sqlite3 * db = NULL;
CString strFilePath; //Êý¾Ý¿â´æ´¢Â·¾¶
//·¾¶¸³Öµ£¨Ê¡ÂÔ£©
//Á¬½ÓÊý¾Ý¿â
nRet = sqlite3_open16(strFilePath, &db); //Óм¸¸ö´ò¿ªº¯Êý¿É¹©µ÷Óã¬Ê¹ÓÃWCHARÀàÐÍ·¾¶ÓÃÕâ¸ö
if(nRet != SQLIT ......
1¡¢SQLite¼ò½é
¡¡¡¡SQLiteµÚÒ»¸öAlpha°æ±¾µ®ÉúÓÚ2000Äê5ÔÂ. ÖÁ½ñÒѾÓÐ9¸öÄêÍ·ÁË. SQLiteÒ²ÓÀ´ÁËÒ»¸ö°æ±¾ SQLite 3ÒѾ·¢²¼.
¡¡¡¡SQLiteÊÇÒ»¿îÇáÐ͵ÄÊý¾Ý¿â£¬ÊÇ×ñÊØACIDµÄ¹ØÁªÊ½Êý¾Ý¿â¹ÜÀíϵͳ£¬ËüµÄÉè¼ÆÄ¿±êÊÇǶÈëʽµÄ£¬¶øÇÒÄ¿Ç°ÒѾÔںܶàǶÈëʽ²úÆ·ÖÐʹÓÃÁËËü£¬ËüÕ¼ÓÃ×ÊÔ´·Ç³£µÄµÍ£¬ÔÚǶÈëʽÉ豸ÖУ¬¿ÉÄÜÖ»ÐèÒª¼¸°ÙKµ ......
/*=================================
.* The Standard include file.
.*
.*===============================*/
#include <stdio.h>
#include <stdlib.h>
/*=================================
.*
.* The extend include file.
.*
.*===============================*/
#include "sqlit ......