Windows MobileÏ·ÃÎÊSqliteµÄNative C++·â×°
±³¾°
µ±Ç°Òƶ¯É豸¿ª·¢ÁìÓò£¬ÔÚ±¾µØÊý¾Ý´æ´¢·½Ã棬Sqlite¼¸ºõ³ÉÁËÊÂʵ±ê×¼£¬Andriod (android.database.sqlite)£¬iPhone (SQLite for iPhone SDK ºÍ FMDB for iPhone)£¬Palm WebOS (webOS SQL Tutorial)£¬Ð°汾µÄSymbianÒ²Ö±½Óbuilt-in SqliteÁË(20 million Symbian smartphones shipped in Q3 2007 Newer versions of the SymbianOS have SQLite built in.)¡£ÄÇô×÷ΪÒƶ¯É豸ÁìÓòµÄÖØÒªÒ»Ô±Windows MobileÔõô¿ÉÄÜ´í¹ýSqliteÄØ¡£
¼ò½é
Sqlite¼¸ºõ³ÉÁ¢Òƶ¯É豸¿ª·¢ÁìÓòÊý¾Ý´æ´¢·½ÃæµÄÊÂʵ±ê×¼¡£SqliteÒѾ¹ã·º±»Ê¹Óõ½Andriod£¬iPhone£¬WebOSÒÔ¼°SymbianµÈƽ̨ÁË£¬±¾ÎĽ²ÊöÔÚWindows Mobileƽ̨ÏÂÈçºÎʹÓÃNative C++·ÃÎÊSqlite£¬Í¬Ê±½²ÊöÒ»¸ö·â×°ÀàµÄʵÏÖºÍʹÓá£
SqliteÔ´Âë
SqliteÔ´Âë¿ÉÒÔµ½ SQLite Download Page ÏÂÔØ£¬ÎÒΪÁËÊ¡ÊÂÖ±½ÓʹÓÃÁËsqlite.phxsoftware.comµÄÔÚWindows MobileϵÄbuild¹¤³Ì¡£
SqliteµÄC++·â×°
·â×°ÎÒʹÓÃÁËTyushkov NikolayµÄ·â×°CppSQLite3U¡£ÕâÀï¸ÐлegmkangµÄÍƼö¡£CppSQLite3U·â×°ÊǶÔSqliteÔÓд¿CµÄapi½øÐÐOOµÄC++µÄ·â×°¡£Ö÷Òª·â×°ÒÔϼ¸¸öÀࣺ
1. CppSQLite3DB Êý¾Ý¿âÀ࣬ÓÃÓÚн¨Êý¾Ý¿â£¬´ò¿ª¹Ø±ÕÁ´½Ó£¬Ö´ÐÐDDLºÍDML¡£
2. CppSQLite3Statement ÓÃÓÚÖ´ÐвÎÊý»¯µÄSQL¡£CppSQLite3DB ¿ÉÒÔÖ´ÐÐSQLµ«ÊDz»Ö§³Ö²ÎÊý»¯¡£
3. CppSQLite3Query ÓÃÓÚ¶Á³öÖ´ÐÐSelectºóµÄ²éѯ½á¹û¡£
4. CppSQLite3Exception ÓÃÓÚ²¶×½Òì³£¡£
¼òµ¥Ã÷Á˵ķâ×°ÁËSqlite¡£
·â×°ÀàµÄʹÓÃ
ʹÓ÷½·¨Ô´×ÔÓÚÎÒ¶ÔCppSQLite3UÀàµÄµ¥Ôª²âÊÔ¡£¼ûÔ´ÎļþµÄSqliteHelperTest.h¡£
´´½¨Êý¾Ý¿âÎļþ
TEST(SqliteHelper, CreateDatabase){ try { CppSQLite3DB db; DeleteFile(DB_FILE_NAME); db.open(DB_FILE_NAME); db.close(); } catch(CppSQLite3Exception e) { FAIL(ToString(e.errorMessage()).c_str()); } TRACE("Create database successful.");}µ÷ÓÃCppSQLite3DB µÄopen()º¯ÊýµÄʱºòÈç¹û·¢ÏÖûÓÐÊý¾Ý¿âÎļþ¾Í»áн¨Ò»¸öÊý¾Ý¿âÎļþ¡£SqliteµÄÔ´´úÂëÈçÏÂ(¼ûsqlite3.c)£º
rc = ope
Ïà¹ØÎĵµ£º
CÊý×éµÄСÎÊÌâ
ÕâÀï˵µÄ¶¯Ì¬Êý×éÊÇ¿ÉÒÔ¸ù¾ÝÐèÒª¶¯Ì¬Ôö³¤Õ¼ÓÃÄÚ´æµÄÊý×飬±ÈÈç³ÌÐò³õʼ·ÖÅäÁË100¸öÔªËØ£¬¿ÉÊÇÔËÐÐÁËÒ»¶Îʱ¼äºóÇøÇø100¸ö¿Õ¼ä²»ÄÜÂú×ãÁË£¬ÏÖÔÚÐèÒª400¸ö£¬Ôõô°ìÄØ£»Äǿ϶¨ÐèÒªÔÙ¶îÍâ·ÖÅä300¸ö¡£
CÓïÑÔÓÐrealloc()º¯ÊýÀ´½â¾ö¿Õ¼äÀ©³äµÄÎÊÌ⣬µ«ÊDz»ÒªÍ ......
ÈôÏëÔÚubuntuϱàÒëc/c++´úÂë
Ê×ÏÈ£¬°²×°g++ºÍgdb£¬¿ÉÒÔÔÚÐÂÁ¢µÃÖÐÖ±½Ó°²×°
ÈôÒª±àÒëc£¬È磺
££include
<stdio.h>
int main()
{
printf("Hello,World!\n");
return 0;
}
......
C++ÌṩµÄ±àÒëÔ¤´¦Àí¹¦ÄÜÖ÷ÒªÓÐÒÔÏÂÈýÖÖ£º
¡¡¡¡£¨Ò»£© ºê¶¨Òå
¡¡¡¡£¨¶þ£© Îļþ°üº¬
¡¡¡¡£¨Èý£© Ìõ¼þ±àÒë
¡¡¡¡ÔÚC++ÖУ¬ÎÒÃÇÒ»°ãÓÃconst¶¨Òå·ûºÅ³£Á¿¡£ºÜÏÔÈ»£¬ÓÃconst¶¨Òå³£Á¿±ÈÓÃdefine¶¨Òå³£Á¿¸üºÃ¡£
¡¡¡¡ÔÚʹÓú궨ÒåʱӦעÒâµÄÊÇ£º
¡¡¡¡£¨a£© ÔÚÊéд#define ÃüÁîʱ£¬×¢Òâ<ºêÃû>ºÍ<×Ö·û´®>Ö®¼äÓÿո ......
JAVAºÍC++¶¼ÊÇÃæÏò¶ÔÏóÓïÑÔ¡£Ò²¾ÍÊÇ˵£¬ËüÃǶ¼Äܹ»ÊµÏÖÃæÏò¶ÔÏó˼Ï루·â×°£¬¼Ì³Ë£¬¶à̬£©¡£¶øÓÉÓÚc++ΪÁËÕչ˴óÁ¿µÄCÓïÑÔʹÓÃÕߣ¬¶ø¼æÈÝÁËC£¬Ê¹µÃ×ÔÉí½ö½ö³ÉΪÁË´øÀàµÄCÓïÑÔ£¬¶à¶àÉÙÉÙÓ°ÏìÁËÆäÃæÏò¶ÔÏóµÄ³¹µ×ÐÔ£¡JAVAÔòÊÇÍêÈ«µÄÃæÏò¶ÔÏóÓïÑÔ£¬Ëü¾ä·¨¸üÇåÎú£¬¹æÄ£¸üС£¬¸üÒ×ѧ¡£ËüÊÇÔÚ¶Ô¶àÖÖ³ÌÐòÉè¼ÆÓïÑÔ½øÐÐÁËÉîÈëϸÖÂÑо¿µ ......
static
C++ÖеÄstatic
¡¡¡¡C++µÄstaticÓÐÁ½ÖÖÓ÷¨£ºÃæÏò¹ý³Ì³ÌÐòÉè¼ÆÖеÄstaticºÍÃæÏò¶ÔÏó³ÌÐòÉè¼ÆÖеÄstatic¡£Ç°ÕßÓ¦ÓÃÓÚÆÕͨ±äÁ¿ºÍº¯Êý£¬²»Éæ¼°ÀࣻºóÕßÖ÷Ҫ˵Ã÷staticÔÚÀàÖеÄ×÷Óá£
¡¡¡¡Ò»¡¢ÃæÏò¹ý³ÌÉè¼ÆÖеÄstatic
¡¡¡¡1¡¢¾²Ì¬È«¾Ö±äÁ¿
¡¡¡¡ÔÚÈ«¾Ö±äÁ¿Ç°£¬¼ÓÉϹؼü×Östatic£¬¸Ã±äÁ¿¾Í±»¶¨Òå³ÉΪһ¸ö¾²Ì¬È«¾Ö±ä ......