SQ Lite
[GIF image (2.99 KB)] SQLite ´Â ¾ö¹ÐÈ÷ ¸»Çؼ DBÀÌÁö¸¸ DBMS´Â ¾Æ´Ñ ÆÄÀÏDBÀÔ´Ï´Ù.
1. Ư¡ ¶
2. 3.0¿¡ Ãß°¡µÈ ±â´É ¶
3. ºü¸¥½ÃÀÛ ¶SQLite¶ó´Â DB´Â °£´ÜÈ÷ ¸»Çؼ SQLÀ» »ç¿ëÇÏ¿© ÁúÀÇÇÒ ¼ö ÀÖ´Â ÆÄÀÏDB ÀÌ´Ù.
DB°¡ EmbededµÈ ApplicationÀ» ½±°Ô ÀÛ¼ºÇÒ ¼ö ÀÖÀ» °Í °°´Ù.
õõÈ÷ ÀÌ ²¿¸¶±«¹° DB¿¡ ´ëÇؼ ¾Ë¾Æº¸·Á ÇÑ´Ù.
Quickstart ¿ø¹®º¸±â
Áö°Ü¿î ¸Þ´º¾óºÎÅÍ º¸Áö¸»°í SQLite¸¦ ÀÏ´Ü Ã¼ÇèÇغ¸ÀÚ.
¿©±â¼´Â ÀÏ´Ü Á¦°¡ ¼³Ä¡ÇØ º» À©µµ¿ì¹öÁ¯À» ¼³¸íÇÑ´Ù.
C:\sqlite> sqlite3 test.db C++¿¡¼ÀÇ ±¸Çö ¿¹Á¦(´Ü, 3°³ÀÇ ÇÔ¼ö Á¦°ø- ÃÊ°£´Ü)
#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_close(db); return 0; } 4. »ç¿ë°¡´É ¹®¹ý ¶
|
Love is in the offing. Be affectionate to one who adores you. |