#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include ".\sqlite3_lib\sqlite3.h"
static int _callback_exec(void * notused,int argc, char ** argv, char ** aszColName)
{
int i;
for ( i=0; i<argc; i++ )
{
printf( "%s = %s\n", aszColName[i], argv[i] == 0 ? "NUL" : argv[i] );
}
return 0;
}
void main(int argc,char *argv[])
{
const char * sSQL = "select * from animal;";
const char * sSQL1 = "insert into animal(id) values('233');";
char * pErrMsg = 0;
int ret = 0;
sqlite3 * db = 0;
ret = sqlite3_open("demo.sqb", &db);
printf("%d\n",ret);
if ( ret != SQLITE_OK )
{
fprintf(stderr, "Could not open database: %s", sqlite3_errmsg(db));
exit(1);
}
printf("Successfully connected to database\n");
sqlite3_exec( db, sSQL, _callback_exec, 0, &pErrMsg );
if ( ret != SQLITE_OK )
{
fprintf(stderr, "SQL error: %s\n", pErrMsg);
sqlite3_free(pErrMsg);
}
sqlite3_exec( db, sSQL1, _callback_exec, 0, &pErrMsg );
if ( ret != SQLITE_OK )
{
fprintf(stderr, "SQL error: %s\n", pErrMsg);
sqlite3_free(pErrMsg);
}
sqlite3_exec( db, sSQL, _callback_exec, 0, &pErrMsg );
if ( ret != SQLITE_OK )
{
fprintf(stderr, "SQL error: %s\n", pErrMsg)
±¾ÎĵÄÄÚÈÝÊÇ Win32 API£¨ÌرðÊǽø³Ì¡¢Ï̺߳͹²ÏíÄÚ´æ·þÎñ£©µ½ POWER ÉÏ Linux µÄÓ³Éä¡£±¾ÎÄ¿ÉÒÔ°ïÖúÄúÈ·¶¨ÄÄÖÖÓ³Éä·þÎñ×îÊʺÏÄúµÄÐèÒª¡£×÷ÕßÏòÄúÏêϸ½éÉÜÁËËûÔÚÒÆÖ² Win32 C/C++ Ó¦ÓóÌÐòʱÓöµ½µÄ API Ó³Éä¡£
¸ÅÊö
Óкܶ෽ʽ¿ÉÒÔ½« Win32 C/C++ Ó¦ÓóÌÐòÒÆÖ²ºÍǨÒƵ½ pSeries ƽ̨¡£Äú¿ÉÒÔʹÓÃÃâ·ÑÈí¼þ»òÕßµÚÈý·½¹¤¾ßÀ´ ......
Ò»¡¢ º¯Êý²ÎÊý´«µÝ»úÖƵĻù±¾ÀíÂÛ ¡¡¡¡º¯Êý²ÎÊý´«µÝ»úÖÆÎÊÌâÔÚ±¾ÖÊÉÏÊǵ÷Óú¯Êý£¨¹ý³Ì£©ºÍ±»µ÷Óú¯Êý£¨¹ý³Ì£©ÔÚµ÷Ó÷¢Éúʱ½øÐÐͨÐŵķ½·¨ÎÊÌâ¡£»ù±¾µÄ²ÎÊý´«µÝ»úÖÆÓÐÁ½ÖÖ£ºÖµ´«µÝºÍÒýÓô«µÝ¡£ÒÔÏÂÌÖÂ۳Ƶ÷ÓÃÆäËûº¯ÊýµÄº¯ÊýΪÖ÷µ÷º¯Êý£¬±»µ÷Óõĺ¯ÊýΪ±»µ÷º¯Êý¡£¡¡¡¡Öµ´«µÝ£¨passl-by-value£©¹ý³ÌÖУ¬±»µ÷º¯ÊýµÄÐÎʽ²Î ......