mysql C APIÇóÖú
дÁËÒ»¶Î³ÌÐò
C/C++ code:
..
MYSQL* mysql£»
MYSQL_RES* res;
//ÎÒÏëʵÏÖÒ»¸ö²é¿´ÓÐûÓÐ mysql½á¹¹£¬Èç¹ûûÓоÍÁ¬½Ó¡£
void connect()
{
mysql_init(mysql);
mysql_realconnect(....);
}
function a ()
{
if(mysql==??)
connect();
else
dosomequery();
}
function b()
{
if(mysql==??)
connect();
else
dosomeotherquery();
}
int main()
{
...
}
ÕâÑùÎÒµ÷ÓÃÒ»´Îa »òÕßbÖ®ºó±£Ö¤ ²»ÓÃÔÙÖØÐÂÁ¬½ÓÊý¾Ý¿â£¬Ö»´´½¨Ò»´Î mysql½á¹¹¡£
»»¾ä»°Ëµ¾ÍÊÇÔõôÑùÀ´Ð´ÉÏÃæÓï¾äÖÐÎʺŵĵط½£¬ÔõôÀ´ÅÐ¶Ï mysqlÒѾÁ¬½ÓÁË¡£
function a ()
{
if(connect()!=null)
else
dosomequery();
}
ÄܽâÊÍÒ»ÏÂÕâ¸öÊÇʲôÒâ˼£¿ connect ÊǸövoidÐ͵ĺ¯Êý£¬ÎÒ²»Ì«Àí½âÕâ¸ö×ö·¨
ÈçÐèÒªÔĶÁ¸Ã»Ø¸´£¬ÇëµÇ¼»ò×¢²áCSDN!
Ïà¹ØÎÊ´ð£º
ÔÚ²éѯºó½«²éѯ³öÀ´µÄÖµ¸³¸ø¸÷ÊäÈë¿ò
<c:if test="${not empty dataValue}">
fm.SAMPLING_DATE.value=" <c:out value='${dataValue.SAMPLING_DATE}'/ ......
¸÷λÇë°ïÎÒ¿´Ò»ÏÂÕâ¸ö¶«Î÷£¬ ÎÒÒªÔÚcÓïÑÔÖÐʵÏÖÀ¨ºÅÆ¥Å䣬Éè¼Æ˼·£º°Ñ´ÓÁ´Õ»ÖÐɨÃèµÃµ½µÄ'}',¡®]',')'ÏÈ´æ´¢µ½¶¯Ì¬ÉêÇëµÄÄÚ´æ¿Õ¼äÖУ¬µ±É¨Ãèµ½¡®{','[','('ʱ ÔÚµ¯³öÏÈÇ°´ ......
Ëã·¨Á÷³Ì
±¾Îĸù¾Ý¡¶ÖйúÒøÁªÖ±ÁªPOSÖն˹淶¡·µÄ²ûÊö£¬ÓÃCÓïÑÔ±à³ÌʵÏÖ£¬¸ÃËã·¨ÔÚʵ¼ÊµÄÉÌÒµPOSÖÕ¶ËÖÐʹÓá£POSÖն˲ÉÓãţãµļÓÃÜ·½Ê½£¬¼òÊöÈçÏ£º
a) ½«Óû·¢Ë͸øPOSÖÐÐĵÄÏûÏ¢ÖУ¬´ÓÏûÏ¢ÀàÐÍ£¨MTI£©µ½63Ó ......
ÇëÎÊÏÂC/SµÄÎïÀí½á¹¹£¬ÊDz»ÊÇÕâÑùµÄ£º
һ̨·þÎñÆ÷£¬ÉÏÃæÖ»ÔËÐÐÒ»¸öÊý¾Ý¿â£¬È»ºóÊǶà¸ö¿Í»§¶Ë»ú£¬Ã¿¸ö»ú×ÓÉÏ°²×°Ò»¸ö¿Í»§¶ËÈí¼þ£¬ÔÙ°ÑÊý¾Ý¿âÁ¬½ÓÓû§ÃûÃÜÂë¸øÿ¸ö¿Í»§¶Ë£¬Õâ¸öÃÜÂëÓÉÈí¼þ¼ÓÃÜ·ÅÔÚ¿Í»§¶Ë£¬Óû§µ ......
ÔËÐл·¾³ÊÇunix£¬ÎÒÓÃueÒÔftp·½Ê½Á¬µ½unixÉÏ£¬È»ºóÔÚueÖбàдc³ÌÐò£¬µ«ÔÚunixÏÂÓÃvi¿´³ÌÐòʱ£¬Ã¿ÐкóÃ涼¶àÁËÒ»¸ö^M£¬Õâ¸öÓ¦¸ÃÊÇunixµÄ»»Ðзû£¬Ã¿´ÎÖ»ÄÜɾ³ýÒ»±éÈ»ºó²ÅÄܱàÒ룬·ñÔò»á±¨´í£¬ÇëÎÊÕâÊÇÔÚueÖÐ×Ö·û±àÂëµÄ ......