Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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();


Ïà¹ØÎĵµ£º

2010ÄêSQLiteѧϰ±Ê¼ÇÖ®¶þ


2010ÄêSQLiteѧϰ±Ê¼ÇÖ®¶þ
Ò».½¨Á¢Êý¾Ý¿â
sqlite3.exe test.db
 
¶þ.Ë«»÷sqlite-3_6_16Ŀ¼ÏµijÌÐòsqlite3.exe£¬¼´¿ÉÔËÐÐ
Èý.Í˳ö
.exit
»òÕß
.quit
ËÄ.SQLiteÖ§³ÖÈçÏÂ5ÖÖÊý¾ÝÀàÐÍ
1.NULL£º¿ÕÖµ¡£
2.INTEGER£º´ø·ûºÅµÄÕûÐÍ£¬¾ßÌåÈ¡¾öÓдæÈëÊý×ֵķ¶Î§´óС¡£
3.REAL£º¸¡µãÊý×Ö£¬´æ´¢Îª8-byte IEEE¸¡µãÊý ......

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

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

×ܽáSQLite²»Ö§³ÖµÄSQLÓï·¨ÓÐÄÄЩ


1 TOP
ÕâÊÇÒ»¸ö´ó¼Ò¾­³£Îʵ½µÄÎÊÌ⣬ÀýÈçÔÚSQLSERVERÖпÉÒÔʹÓÃÈçÏÂÓï¾äÀ´È¡µÃ¼Ç¼¼¯ÖеÄÇ°Ê®Ìõ¼Ç¼£º
SELECT TOP 10 * from [index] ORDER BY indexid DESC;
µ«ÊÇÕâÌõSQLÓï¾äÔÚSQLiteÖÐÊÇÎÞ·¨Ö´Ðеģ¬Ó¦¸Ã¸ÄΪ£º
SELECT * from [index] ORDER BY indexid DESC limit 0,10;
ÆäÖÐlimit 0,10±íʾ´ÓµÚ0Ìõ¼Ç¼¿ªÊ¼£¬Íùºó ......

windowsÏÂsqlite°²×°Ê¹ÓúÍÐÔÄÜÓÅ»¯¼°ÉèÖÃ

Ô­ÎÄÁ´½Ó£ºhttp://edu.codepub.com/2008/1231/805.php
windowsÏÂsqlite°²×°Ê¹ÓúÍÐÔÄÜÓÅ»¯¼°ÉèÖÃ
      sqliteÊÇǶÈëʽSQLÊý¾Ý¿âÒýÇæSQLite£¨SQLite Embeddable SQL Database Engine£©µÄÒ»¸öÀ©Õ¹¡£SQLiteÊÇÒ»¸öʵÏÖǶÈëʽSQLÊý¾Ý¿âÒýÇæСÐÍCÓïÑԿ⣨C library£©£¬ÊµÏÖÁ˶ÀÁ¢µÄ£¬¿ÉǶÈëµÄ£¬ÁãÅäÖ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ