SQLite¿ìËÙÈëÃÅ
SQLiteСÇɵÄÌصãʹÆäÔÚǶÈëʽÉÏÀûÓúܹ㷺¡£Ô½À´Ô½¶àµÄÒƶ¯É豸ÉϼÓÈëÁËSQLiteÄ£¿é£¬android,sysmbian, iphone,...ÏÂÃæµÄ½éÉÜÈÃÄã¿ìËÙ²½ÈëSQLiteµÄ´óÃÅ¡£
1. ÏÂÔØ
SQLiteÊÇ¿ªÔ´µÄÏîÄ¿£¬ËùÒÔÄã¿ÉÒÔÏÂÔØÍêËÙµÄÔ´´úÂë¡£¿ª·¢µÄʱºòÄã¿ÉÒÔ°ÑÔ´´úÂëǶÈëÄãµÄ¹¤³Ìµ±ÖУ¬Ò²¿ÉÒÔÓñàÒëºÃµÄ¶þ½øÖÆÎļþ¡£Äã¿ÉÒÔÔÚÕâ¶ùÏÂÔØSQLite.
2.½¨Êý¾Ý¿â
ÔÚÃüÁîÐÐÊäÈ룺sqlite3 test.db¡£ ¾Í¿ÉÒÔ´´½¨Ò»¸öÃûΪtest.dbµÄÊý¾Ý¿â¡£
3.ÔÚ³ÌÐòÖÐÀûÓÃSQLiteÊý¾Ý¿â
ÏÂÃæÊÇÒ»¸ö¼òµ¥µÄC³ÌÐò£¬ չʾÁËÔÚC/C++ÖÐÈçºÎÓÃSQLite¡£
#include <stdio.h>
#include <sqlite3.h>
static int callback(void *NotUsed, int argc, char **argv, char **azColName){
int i;
for(i=0; i<argc; i++){
printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL");
}
printf("\n");
return 0;
}
int main(int argc, char **argv){
sqlite3 *db;
char *zErrMsg = 0;
int rc;
if( argc!=3 ){
fprintf(stderr, "Usage: %s DATABASE SQL-STATEMENT\n", argv[0]);
exit(1);
}
rc = sqlite3_open(argv[1], &db);
if( rc ){
fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db));
sqlite3_close(db);
exit(1);
}
rc = sqlite3_exec(db, argv[2], callback, 0, &zErrMsg);
if( rc!=SQLITE_OK ){
fprintf(stderr, "SQL error: %s\n", zErrMsg);
sqlite3_free(zErrMsg);
}
sqlite3_close(db);
return 0;
}
ÕâÓÃÓõ½Á˵ÄÈý¸ö½Ó¿Ú·Ö±ðÊÇ£ºsqlite3_open() Ëü´ò¿ªÊý¾Ý¿â¡£sqlite3_exec() Ö´ÐÐSQLÓï¡£ sqlite3_close()¹Ø±ÕÊý¾Ý¿â¡£
Ïà¹ØÎĵµ£º
ÔÚSQLite on BlackBerryÉÏ£¬JDBC·ÃÎÊÊý¾Ý¿â£¬È±Ê¡ÊÇÒÔUTF-8±£´æÊý¾Ýµ½Êý¾Ý¿âÀïÃæµÄ£¬Ã¿¸öÖÐÎÄͨ³£ÊÇ3¸ö×Ö½Ú±£´æµ½Êý¾Ý¿âÉÏÃæµÄ¡£
Àý×Ó´úÂë²Î¿¼£º
BlackBerry sample - SQLiteDemo¡£
×¢Ò⣺ÔÚ²åÈëÖÐÎĵÄʱºò£¬ÇëʹÓÃStatement.bindÖ¸ÁÔÚÎҵIJâÊÔÖУ¬¿ÉÒԺܺõı£´æÖÐÎÄÊý¾Ý¡£¶ÁÈ¡µÄʱºòÖ»ÐèҪʹÓÃResult ......
package com.jiao.sqlite;
import android.app.Activity;
import android.database.Cursor;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widg ......
sqliteʱ¼äº¯Êý£¨×ª£©
2007Äê12ÔÂ10ÈÕ ÐÇÆÚÒ» 13:33
תÌùÔÒò£º×î½üÉè¼ÆÁËÒ»¸ö¿çÊý¾Ý¿âµÄº¯Êý£¬À´²âÊÔ²âÊÔsqlite¡£
SQLite·ÖÒ³ÏÔʾ£ºSelect * from news order by id
desc Limit 10 Offset 10
ÕâƪÎÄÕÂÊǸù¾Ý SQLite ¹Ù·½ WIKI ÀïµÄÄÚÈÝ·Ò룬Èç¹ûÓÐʲô·Òë²»µ±µÄµØ·½Ï£Íû´ó¼ÒÖ¸³ö£¬±Ï¾¹ÎÒµÄÓ¢ÎÄˮƽʵÔںܲ SQ ......
sqlite3: Ò»¸öSQLiteÊý¾Ý¿âµÄÃüÁîÐнӿÚ
ÒëÕß×¢
ÔÎĵØÖ·£ºhttp://www.sqlite.org/sqlite.html
SQLite¿â°üº¬Ò»¸öÃû×Ö½Ð×ösqlite3 µÄÃüÁîÐÐ,Ëü¿ÉÒÔÈÃÓû§ÊÖ¹¤ÊäÈë²¢Ö´ÐÐÃæÏòSQLiteÊý¾Ý¿âµÄSQLÃüÁî¡£±¾ÎĵµÌṩһ¸öÑùʹÓÃsqlite3µÄ¼òҪ˵Ã÷¡£
¿ªÊ¼
Æô¶¯sqlite3 ³ÌÐò£¬½ö½öÐèÒªÇÃÈ ......