java¶ÔmysqlÊý¾Ý¿âµÄµ¼Èëµ¼³ö
//µ¼³ö
String mysql="mysqldump -uroot -proot --opt databasename > d:/test.sql";
java.lang.Runtime.getRuntime().exec("cmd /c "+mysql);
//µ¼Èë
String mysql="mysqladmin -uroot -proot create databasename";
java.lang.Runtime.getRuntime().exec("cmd /c "+mysql);
path="mysql databasename < d:/test.sql";
java.lang.Runtime.getRuntime().exec("cmd /c "+path);
Ïà¹ØÎĵµ£º
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔÇ°£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......
À´×Ô£ºhttp://it.china-b.com/zx/linuxsjk/20090525/24129_1.html
ÕªÒª£ºMySQLÊÇÒ»¸ö¸ßËٶȡ¢¸ßÐÔÄÜ¡¢¶àÏ̵߳ĹØϵÐÍÊý¾Ý¿â
ÖÎÀíϵͳ£¬ÊÊÓÃƽ̨¶à£¬¿ÉÀ©Õ¹ÐÔÇ¿¡£ÔÚʵ¼ÊÉú²ú»·¾³ÖУ¬²¿ÊðºÍʵÏÖ¾ßÓÐÒ»¶¨¸ºÔؾùºâ¹¦ÄܵÄMySQL·þÎñÆ÷¼¯Èº£¬¶ÔÓÚÌá¸ßÓû§Êý¾Ý¿â
Ó¦ÓÃϵͳµÄÐÔÄÜ¡¢ËٶȺÍÎȶ¨ÐÔ¾ßÓÐÃ÷ÏÔµÄ×÷Óᣱ¾ÎļòÒª½éÉÜÁËÔÚ ......
select * for updateËø±íµÄÎÊÌâ
ÓÉÓÚInnoDBÔ¤ÉèÊÇRow-Level Lock£¬ËùÒÔÖ»ÓС¸Ã÷È·¡¹µÄÖ¸¶¨Ö÷¼ü£¬MySQL²Å»áÖ´ÐÐRow lock (Ö»Ëøס±»Ñ¡È¡µÄ×ÊÁÏÀý) £¬·ñÔòMySQL½«»áÖ´ÐÐTable Lock (½«Õû¸ö×ÊÁÏ±íµ¥¸øËøס)¡£
¾Ù¸öÀý×Ó:
¼ÙÉèÓиö±íµ¥products £¬ÀïÃæÓÐid¸úname¶þ¸öÀ¸Î»£¬idÊÇÖ÷¼ü¡£
Àý1: (Ã÷È·Ö¸¶¨Ö÷¼ü£¬²¢ÇÒÓд˱Ê×ÊÁÏ£¬ ......
MySQLµÄÒ²Ö§³Ö´æ´¢¹ý³Ì£¬º¯Êý£¬´¥·¢Æ÷¡£
ÒÔϸ÷¸ö¹¦ÄܵÄÏêÊö£¬Ö÷ÒªÊÇʾÀý¡£
/**1.¶¨Òå·Ö¸î·û*/
DELIMITER //
/**2.´´½¨º¯Êý-¼ÆËãÁ½ÊýÖ®ºÍ*/
CREATE FUNCTION f_sum(num1 INT,num2 INT) RETURNS INT
BEGIN
RETURN num1+num2;
END;
//
/**
*3.´´½¨´æ´¢¹ý³Ì
*˼·£º3.1.Óиô洢¹ý³ÌÔòɾ³ý£¬3.2ÓÐʹÓõÄÖмä±í ......
DAT_E,TIM_E,DAT_ETIME,TIM_ESTAMP,Y_EAR
MySQLÖ§³Ö¶àÖÖ¸ñʽ»¯·½Ê½£¬²åÈëʱ¿ÉÒÔÊÇ×Ö·û´®£¬¿ÉÒÔʹÊý×Ö¡£
MySQL´ú±í×Ö·û´®µÄ·½Ê½ÓÐÁ½ÖÖ£¬Ò»Êǵ¥ÒýºÅ£¬ÁíÒ»ÖÖÊÇË«ÒýºÅ¡£
ÓÖÒ»´ÎÌύʧ°Ü£¬¿´À´CSDNµÄBUG»¹ÊǺܴóµÄ¡£
ÔÒò»ù±¾È·¶¨£¬ÊÇÒòΪDATE£¬TIME£¬DATETIME£¬TIMESTAMP£¬YEARΪMySQLÊý¾ÝµÄ¹Ø¼ü×Ö£¬Ò²ÊÇÆäËûÊý¾Ý¿âµÄ¹Ø¼ü× ......