Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : Sqlite

ÊÕ¼¯Ç¶ÈëʽÊý¾Ý¿âSqliteÒÆÖ²×ÊÁÏ

sqlite-3.3.6±àÒë°²×°Óë½»²æ±àÒëÈ«¹ý³ÌÏêϸ¼Ç¼
ÏÂÎĽéÉܵÄÄÚÈݶ¼ÊÇ»ùÓÚ Linux RedHat 9.0 ƽ̨µÄ¡£
Ò»¡¢PC»ú±àÒë°²×°
ÇëÔĶÁÔÚ°²×°°üÀïµÄ INSTALL Îļþ¡£»òÕßʹÓÃPEAR installer with "pear install sqlite"¡£SQLiteÒѾ­ÄÚÖÃÁË£¬Äã²»ÐèÒª°²×°Èκθ½¼ÓµÄÈí¼þ£¨additional software£©¡£
Windows users¿ÉÒÔÏÂÔØSQLiteÀ©Õ¹DLL£¨php_sqlite.dl£©¡£
ÕâÀï¼òµ¥½éÉÜһϣº
¼ÙÉèÄãµÃµ½µÄÊÇÔ´´úÂësqlite-3.3.6.tar.gz£¬ÕâÀォ¸æËßÄãÔõô±àÒëËü¡£
½âѹsqlite-3.3.6.tar.gz µ½ /homeĿ¼ÏÂ
For example:
tar zxvf sqlite-3.3.6.tar.gz -C /home           
cd /home
mkdir sqlite-ix86-linux
cd /home/sqlite-ix86-linux/
../sqlite-3.3.6/configure --prefix=/home/sqlite-ix86-linux/
±àÒë²¢°²×°£¬È»ºóÉú³É°ïÖúÎĵµ
make && make install && make doc
Èç¹û³öÏÖÏÂÁдíÎó
../sqlite-3.3.6/src/tclsqlite.c: In function `DbUpdateHandler':
../sqlite-3.3.6/src/tclsqlite.c:333: warning: passing arg 3 of `Tcl_ListObjAppendElement' makes pointer from integer without a cast
../sqlit ......

SQLiteÔÚVCϵÄʹÓÃ

Ò»¡¢SQLite¼ò½é
SQLite ÊÇÓÃCÓïÑÔ±àдµÄ¿ªÔ´Êý¾Ý¿â£¬Ö÷ÒªÓÃÓÚǶÈëʽ£¬ÄãÒ²¿ÉÒÔ°ÑËü¼¯³ÉÔÚ×Ô¼ºµÄ×ÀÃæ³ÌÐòÖУ¬Ò²ÓÐÈ˽«ÆäÌæ´úAccess£¬ÓÃ×÷ºǫ́Êý¾Ý¿â¡£
SQLite Ö§³Ö¶àÊýSQL92±ê×¼£¬ÀýÈ磺Ë÷Òý¡¢ÏÞÖÆ¡¢´¥·¢ºÍ²é¿´Ö§³Ö¡£
Ö§³Ö NULL¡¢INTEGER¡¢REAL¡¢TEXT ºÍ BLOB Êý¾ÝÀàÐÍ£¬Ö§³ÖÊÂÎñ¡£
¶þ¡¢ÏÂÔØSQLite
SQLite¿ÉÒÔµ½¹Ù·½Õ¾µãÏÂÔØ
http://www.sqlite.org/download.html
°üÀ¨£ºLinux,Mac OS X, WindowsϵÄÒѱàÒëÎļþÒÔ¼°Ô´´úÂë¡¢°ïÖúÎĵµ¡£
Èý¡¢SQLiteµÄ¼òµ¥Ê¹ÓÃ
3.1 ½¨Á¢Êý¾Ý¿â
C:\sqlite-3_6_11> sqlite3.exe dbname.db
sqlite3.exeºóÃæ¸úÊý¾Ý¿âÎļþÃû
3.2 ´´½¨Êý¾Ý±í
sqlite> create table users(userid varchar(20) PRIMARY KEY,
...> age int,
...> birthday datetime);
3.3 Ìí¼Ó¼Ç¼
insert into users values('wang',20,'1989-5-4');
insert into users values('li',22,'1987-11-16');
3.4 ²éѯ¼Ç¼
select * from users order by birthday;
3.5 ɾ³ý¼Ç¼
delete from users where userid='wang';
3.6 Í˳ösqlite
sqlite> .exit
SQLiteÊý¾Ý¿âµÄÊý¾Ý½á¹¹ÊÇ´æÖüÔÚ "sqlite_master" ±íÖÐ
¾ßÌåÃüÁî¿ÉÒÔÊäÈë .help²é¿´»ò²Î¿¼°ïÖúÎ ......

SQLiteʹÓÃ

OS X×Ô´Ó10.4ºó°ÑSQLiteÕâÌ×Ï൱³öÃûµÄÊý¾Ý¿âÈí¼þ£¬·Å½øÁË×÷ҵϵͳ¹¤¾ß¼¯Àï¡£OS X°ü×°µÄÊǵÚÈý°æµÄSQLite£¬ÓÖ³ÆSQLite3¡£ÕâÌ×Èí¼þÓм¸¸öÌØÉ«£º
Èí¼þÊôÓÚ¹«¹²²Æ£¨public domain£©£¬SQLite¿É˵ÊÇijÖÖ¡¸ÃÀµÂÈí¼þ¡¹£¨virtueware£©£¬×÷Õß±¾ÈË·ÅÆú×Å×÷Ȩ£¬¶ø¸øʹÓÃSQLiteµÄÈËÒÔϵġ¸×£¸£¡¹£¨blessing£©£º
May you do good and not evil. Ô¸ÄãÐÐÉÆĪÐжñ
May you find forgiveness for yourself and forgive others. Ô¸ÄãÔ­ÁÂ×Ô¼º¿íË¡ËûÈË
May you share freely, never taking more than you give. Ô¸Äã¿íÐÄÓëÈË·ÖÏí£¬ËùÈ¡²»¶àÓÚÄãËùÊ©Óè
Ö§Ô®´ó¶àÊýµÄSQLÖ¸ÁÏÂÃæ»á¼òµ¥½éÉÜ£©¡£
Ò»¸öµµ°¸¾ÍÊÇÒ»¸öÊý¾Ý¿â¡£²»ÐèÒª°²×°Êý¾Ý¿â·þÎñÆ÷Èí¼þ¡£
ÍêÕûµÄUnicodeÖ§Ô®£¨Òò´ËûÓпçÓïϵµÄÎÊÌ⣩¡£
ËٶȺܿ졣
Ä¿Ç°ÔÚOS X 10.4ÀSQLiteÊÇÒÔ/usr/bin/sqlite3µÄÐÎʽ°ü×°£¬Ò²¾Í˵ÕâÊÇÒ»¸öÃüÁîÁй¤¾ß£¬±ØÐëÏÈ´ÓÖն˻ú£¨Terminal.app»òÆäËû³ÌÐò£©½øÈëshellÖ®ºó²ÅÄÜʹÓá£ÍøÂçÉÏÓÐһЩϢЭÖúʹÓÃSQLiteµÄÊÓ¾õ»¯¹¤¾ß£¬µ«Ëƺõ¶¼Ã»ÓÐÏñCocoaMySQL£¨ÅäºÏMySQLÊý¾Ý¿âʹÓã©ÄÇ°ãºÃÓ᣻òÐíËæʱÓоªÏ²Ò²Î´¿ÉÖª£¬ÒÔϽö½éÉÜÃüÁîÁеIJÙ×÷·½Ê½¡£
SQLite¹ËÃû˼ÒéÊÇÒÔSQLΪ»ù´¡µÄÊý¾Ý¿âÈí¼þ£ ......

Unity3d ÖÐÎÄÊäÈëÊä³ö ²éѯsqliteÊý¾Ý¿â

CnGuiDB.js
var db : dbAccess;
public var mskin : GUISkin;
private var mstring : String;
var inputStr;
function Start(){
inputStr = "1";
}
function search(mid)
{
db = new dbAccess();
db.OpenDB("db1.db");
var tableName = "myTable";
// table name, I want to return everyone whose first name is Bob when their last name is = to Sagat, this returs an array
var resultArray = db.SingleSelectWhere(tableName, "name", "id", "=", mid); // Remember the '' on String values
mstring=resultArray[0];
print(mstring);
// of course you can loop through them all if you wish
db.CloseDB();
}
function OnGUI()
{
GUI.skin=mskin;
inputStr =GUI.TextField(new Rect(200, 154, 200, 30),inputStr,25);
if(GUI.Button(new Rect(400,154,60,30),"search"))
{
search(inputStr);
}
GUI.Label(new Rect(10,400,400,900),mstring);
}
±à¼­Ä£Ê½ db1·ÅÔÚ¹¤³Ì×ÜĿ¼Ï£¬Óëassets\library\tempͬ¼¶
exe²¿Êð db1·ÅÔÚ¿ÉÖ´ÐÐÎļþͬ¼¶
sqlite²ÎÕÕ£º
http://forum.unity3d.com/viewto ......

Unity3d ʹÓÃsqliteÊý¾Ý¿â

dbAccess.js
import System.Data; // we import our data class
import Mono.Data.SqliteClient; // we import our sqlite client

class dbAccess {
// variables for basic query access
private var connection : String;
private var dbcon : IDbConnection;
private var dbcmd : IDbCommand;
private var reader : IDataReader;

function OpenDB(p : String){
connection = "URI=file:" + p; // we set the connection to our database
dbcon = new SqliteConnection(connection);
dbcon.Open();
}

function BasicQuery(q : String, r : boolean){ // run a baic Sqlite query
dbcmd = dbcon.CreateCommand(); // create empty command
dbcmd.CommandText = q; // fill the command
reader = dbcmd.ExecuteReader(); // execute command which returns a reader
if(r){ // if we want to return the reader
return reader; // return the reader
}
}

function CreateTable(name : String, col : Arra ......

SQLite ¼ò½é

SQLite ÊÇÒ»¸öʵÏÖÁËÍ걸µÄ£¨self-contained)£¬¿ÉǶÈëµÄ(embeddable)£¬ÁãÅäÖÃ(zero-configuration)µÄSQLÊý¾Ý¿âÒýÇæµÄСÐ͵ÄCº¯Êý¿â¡£Ëü°üº¬ÒÔϵÄÌص㣺
.
    ÊÂÎñ´¦ÀíÔ­×Ó»¯(atomic)£¬Ò»Ö»¯(consistent)£¬³Ö¾Ã»¯(isolated)£¬¾øÔµ»¯(durable)£¬¼´Ê¹ÊÇÔÚϵͳ±ÀÀ£ºÍµôµçʱ
    ÁãÅäÖ㬲»ÐèÒªÉèÖûòÕß¹ÜÀí
    ʵÏÖÁËSQL92µÄ´ó²¿·Ý±ê×¼ £¨²»Ö§³ÖÌØÐÔ£©
    Õû¸öµÄÊý¾Ý¿â±»´¢´æÔÚµ¥¸öµÄ´ÅÅÌÎļþÉÏ
    Êý¾Ý¿âÎļþÄܹ»±»²»Í¬×Ö½ÚÐòµÄ»úÆ÷Ëù¹²ÓÃ
    Ö§³ÖT×Ö½ÚºÍG×Ö½Ú´óСµÄ×Ö·û´®ºÍ¿é(blob)
    СÐ͵ĴúÂëºÛ¼£(small code footprint)£¬ÍêÈ«ÅäÖúõÄСÓÚ250kiB£¬Ê¡ÂÔµôһЩ¿ÉÑ¡ÓõÄÌØÐԵĽ«Ð¡ÓÚ150KiB
    ´ó²¿·ÖµÄÒ»°ã²Ù×÷±ÈÁ÷ÐеÄC/SÊý¾Ý¿âÒª¿ì
    ¼òµ¥ÈÝÒ×ʹÓõÄAPI¡£
    °üº¬ÁËTCLµÄ°ó¶¨£¬ÒÔ¼°ÆäËû¸÷ÖÖ²»Í¬µÄ¿ÉÓÃÓïÑԵİ󶨡£
    ´úÂëÓÐÁ¼ºÃµÄ×¢ÊÍ£¬²âÊÔ¸²¸ÇÂʳ¬¹ý98£¥
    Äܹ»ÒÔµ¥¸ö¼òµ¥ANSI£­CµÄÔ´ÎļþµÄÐÎʽÇáÒ׵IJåÈëµ½ÁíÒ»¸ö¹¤³ÌÖÐ
    Íê± ......
×ܼǼÊý:155; ×ÜÒ³Êý:26; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [9] [10] [11] [12] 13 [14] [15] [16] [17] [18]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ