Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÔÚVC6ÖÐʹÓÃc API·½Ê½Á¬½ÓMySQLÊý¾Ý¿â

ÔÚVC6ÖÐʹÓÃc API·½Ê½Á¬½ÓMySQLÊý¾Ý¿â
Ò»¡¢»·¾³ÅäÖÃ
1¡¢ÔÚMySqlµÄ¹Ù·½ÍøÕ¾ÏÂÔØmysql-connector-c-noinstall£¬²¢½«½âѹºóµÄbinºÍincludeÎļþ¼Ð¿½±´µ½MysqlµÄ°²×°Ä¿Â¼
2¡¢ÉèÖÃVC6»·¾³£¬ÔÚvc¹¤¾ß-Ñ¡Ïî-Ŀ¼£¬¼ÓÈë¸Õ²ÅµÄIncludeÎļþ¼ÐµÄ·¾¶£¬ÀýÈ磺C:\Program Files\MySQL\MySQL Server 5.1\include
¶þ¡¢¹¤³ÌÉèÖÃ
3¡¢½«libÎļþ¼ÐÖеÄlinmysql.libºÍlibmysql.dll¿½±´µ½¹¤³ÌĿ¼Ï£¬¹¤³Ì-ÉèÖÃ-Á¬½Ó£¬ÔÚ¶ÔÏó/¿âÄ£¿éÖÐÌí¼Ówsock32.libºÍlibmysql.lib
Èý¡¢Ê¾Àý
4¡¢Ïȵ¼Èë²âÊÔ³ÌÐòËùÐèµÄ»·¾³£¬½«ÒÔÏÂSQLÓï¾ä±£´æΪsql½Å±¾Îļþ²¢µ¼Èë
#VC6ͨ¹ýAPIÁ¬½ÓMysql²âÊÔ»·¾³
#´´½¨Êý¾Ý¿â
drop database if exists `test`;     #Èç¹ûÓÐÕâ¸öÊý¾Ý¿â£¬ÔòÒƳýËü create database test;               #´´½¨Êý¾Ý¿â
use test;           #ʹÓÃÊý¾Ý¿â
#´´½¨±íUser£¬±£´æ»áÔ±ÊôÐÔ
drop table if exists `User`;
create table User (
    id int(11) not null auto_increment,
    name varchar(20),
    age int(11),
    primary key (id)
);
#²åÈëһЩÊý¾Ý
insert into user values (NULL, 'name1', 11);
insert into user values (NULL, 'name2', 22);
insert into user values (NULL, 'name3', 33);
5¡¢²âÊÔ´úÂë
#include <windows.h>
#include <mysql.h>
#include "stdio.h"
MYSQL mysql, *sock; //mysqlÁ¬½Ó
MYSQL_RES *res; //Õâ¸ö½á¹¹´ú±í·µ»ØÐеÄÒ»¸ö²éѯ½á¹û¼¯
MYSQL_ROW row; //Ò»¸öÐÐÊý¾ÝµÄÀàÐÍ°²È«(type-safe)µÄ±íʾ
char query[150]; //²éѯÓï¾ä
bool ConnectDatabase(); //º¯ÊýÉùÃ÷
void FreeConnect();
bool QueryDatabase();
bool InsertData();
int main()
{
ConnectDatabase();
QueryDatabase();
InsertData();
QueryDatabase();
FreeConnect();
return 0;
}
//Á¬½ÓÊý¾Ý¿â
bool ConnectDatabase()
{
//³õʼ»¯mysql
mysql_init(&mysql); //Á¬½Ómysql£¬Êý¾Ý¿â
if (!(sock = mysql_real_connect(&mysql,"localhost", "root", "root", "test",0,NULL,0)))
{
printf( "Error connecting to datab


Ïà¹ØÎĵµ£º

cmdÏÂmysqlÐÂÊÖÁ·ÊÖʵÀý

1,ÔÚcmdÏÂÓÃmysql¿Í»§»úÁ¬½Ómysql·þÎñÆ÷ php³ÌÐòÔ±Õ¾
´ò¿ªcmdºó,ÊäÈë php³ÌÐòÔ±Õ¾
mysql -h localhost -u root -p
phperz.com
Óï·¨: mysqlµ±È»ÊǸæËßcmd,ÕâÊÇmysqlµÄÃüÁîÁË php³ÌÐòÔ±Ö®¼Ò
²ÎÊý -h ÊÇ·þÎñÆ÷µØÖ·,ÔÚ´ËÎÒÃÇÒÔ±¾»úΪÀýÊäÈëlocalhost
-u ÊÇmysqlµÄÓû§Ãû  ÎÒÃÇÓÃmysql µÄĬÈÏÓû§Ãû root phperz ......

ʹÓÃJena½«±¾Ìå´æÈëMySQL——ÎĵµºÍÀý×Ó


 iMarine http://iMarine.blog.163.com
×¢Ã÷£º±¾Îĵµ²Î¿¼Jena 2.5Îĵµ£¬Ê¹ÓÃJena 2.5 APIºÍMySQL 5.0.4-beta-ntÊý¾Ý¿â¡£MySQLÇý¶¯°üʹÓõÄÊÇmysql-connector-java-3.1.10-bin.jar¡£
1 JenaµÄÊý¾Ý¿â½Ó¿Ú
JenaÌṩÁ˽«RDFÊý¾Ý´æÈë¹ØϵÊý¾Ý¿âµÄ½Ó¿Ú£¬Model¡¢Resource¡¢QueryµÈ½Ó¿Ú¿ÉÒÔÓÃÓÚ·ÃÎʺÍά»¤Êý¾Ý¿âÀïµÄRDFÊý ......

c/c++ ×óÖµ ÓÒÖµÌÖÂÛ

×óÖµÐÔ£¨lvalueness£©ÔÚC/C++ÖÐÊDZí´ïʽµÄÒ»¸öÖØÒªÊôÐÔ¡£Ö»ÓÐͨ¹ýÒ»¸ö×óÖµ±í´ïʽ²ÅÄÜÀ´ÒýÓü°¸ü¸ÄÒ»¸ö¶ÔÏó£¨object£©µÄÖµ¡££¨Ä³Ð©Çé¿öÏ£¬ÓÒÖµ±í´ïʽҲÄÜÒýÓã¨refer£©µ½Ä³Ò»¸ö¶ÔÏ󣬲¢ÇÒ¿ÉÄܼä½ÓÐ޸ĸöÔÏóµÄÖµ£¬ºóÊö£©¡£
    ºÎν¶ÔÏó£¿Èç¹ûûÓÐÃ÷ȷ˵Ã÷£¬ÕâÀï˵µÄ¶ÔÏ󣬺ÍÏÁÒåµÄÀà/¶ÔÏó£¨class/object£© ......

CºÍC++µÄ±ê×¼¿â

CºÍC++µÄ±ê×¼¿â
ĬÈÏ·ÖÀà   2008-02-28 14:28   ÔĶÁ3   ÆÀÂÛ0  
×ֺţº ´ó´ó  ÖÐÖР СС
http://blog.chinaunix.net/u/6776/showart_186792.html C/C++Éî²ã̽Ë÷
    ±¾Ð¡½ÚÎÒÃǸÅÀÀÒ»ÏÂC/C++±ê×¼¿âµÄȫò¡£
    C/C++±ê×¼¿âµÄÄÚ ......

¹ØÓÚAJAX¡¢B/S¡¢C/SµÄ¼¸¸ö˼¿¼


B/SΪºÎÄÑÓÚÌṩºÃµÄÓû§½»»¥ÌåÑé?
×î´óÎÊÌâÓм¸¸ö£º
¡¡¡¡(1)ÎÞ״̬µÄHTTPЭÒé
¡¡¡¡WINDOWS´°Ìå¼äÄܹ»Í¨¹ýÄÚ´æÖ±½Ó½»»»ÐÅÏ¢£¬µ«×÷ΪB/S¼Ü¹¹Í¨Ñ¶»ù´¡Ð­ÒéµÄHTTPÊÇÎÞ״̬µÄ¡£
¡¡¡¡Èç¹û½«ä¯ÀÀÆ÷¿´³ÉÊÇ¿ÍÈË£¬Web·þÎñÆ÷¿´³ÉÊÇÂùݣ¬ÔÚHTTPЭÒéµÄ¹ÜÀí֮ϣ¬»á³öÏÖÕâÖÖÇé¿ö£º²»¹Üij¿ÍÈËÀ´·Ã¶àÉٴΣ¬Web·þÎñÆ÷¶¼½«ÆäÊÓΪµ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ