mysql 5.0´æ´¢¹ý³Ìѧϰ×ܽá
from:http://www.ccvita.com/100.html
mysql 5.0´æ´¢¹ý³Ìѧϰ×ܽá
Ò».´´½¨´æ´¢¹ý³Ì
1.»ù±¾Óï·¨£º
create procedure sp_name()
begin
………
end
2.²ÎÊý´«µÝ
¶þ.µ÷Óô洢¹ý³Ì
1.»ù±¾Óï·¨£ºcall sp_name()
×¢Ò⣺´æ´¢¹ý³ÌÃû³ÆºóÃæ±ØÐë¼ÓÀ¨ºÅ£¬ÄÄŸô洢¹ý³ÌûÓвÎÊý´«µÝ
Èý.ɾ³ý´æ´¢¹ý³Ì
1.»ù±¾Óï·¨£º
drop procedure sp_name//
2.×¢ÒâÊÂÏî
(1)²»ÄÜÔÚÒ»¸ö´æ´¢¹ý³ÌÖÐɾ³ýÁíÒ»¸ö´æ´¢¹ý³Ì£¬Ö»Äܵ÷ÓÃÁíÒ»¸ö´æ´¢¹ý³Ì
ËÄ.Çø¿é£¬Ìõ¼þ£¬Ñ»·
1.Çø¿é¶¨Ò壬³£ÓÃ
begin
……
end;
Ò²¿ÉÒÔ¸øÇø¿éÆð±ðÃû£¬È磺
lable:begin
………..
end lable;
¿ÉÒÔÓÃleave lable;Ìø³öÇø¿é£¬Ö´ÐÐÇø¿éÒÔºóµÄ´úÂë
2.Ìõ¼þÓï¾ä
if Ìõ¼þ then
statement
else
statement
end if;
3.Ñ»·Óï¾ä
(1).whileÑ»·
[label:] WHILE expression DO
statements
END WHILE [label] ;
(2).loopÑ»·
[label:] LOOP
statements
END LOOP [label];
(3).repeat untilÑ»·
[label:] REPEAT
statements
UNTIL expression
END REPEAT [label] ;
Îå.ÆäËû³£ÓÃÃüÁî
1.show procedure status
ÏÔʾÊý¾Ý¿âÖÐËùÓд洢µÄ´æ´¢¹ý³Ì»ù±¾ÐÅÏ¢£¬°üÀ¨ËùÊôÊý¾Ý¿â£¬´æ´¢¹ý³ÌÃû³Æ£¬´´½¨Ê±¼äµÈ
2.show create procedure sp_name
ÏÔʾijһ¸ö´æ´¢¹ý³ÌµÄÏêϸÐÅÏ¢
mysql´æ´¢¹ý³ÌÖÐÒªÓõ½µÄÔËËã·û
mysql´æ´¢¹ý³Ìѧϰ×ܽᣲÙ×÷·û
ËãÊõÔËËã·û
+ ¼Ó SET var1=2+2; 4
- ¼õ SET var2=3-2; 1
* ³Ë SET var3=3*2; 6
/ ³ý SET var4=10/3; 3.3333
DIV Õû³ý SET var5=10 DIV 3; 3
% È¡Ä£ SET var6=10%3 ; 1
±È½ÏÔËËã·û
> ´óÓÚ 1>2 False
< СÓÚ 2<1 False
<=&nbs
Ïà¹ØÎĵµ£º
½ñÌì×°ÁËһ̨Linuxϵͳ£¬ÒÔÇ°¶¼ÊÇRedHat£¬ºóÀ´Ìý˵ÓÐFedoraÁË£¬Ò»Ö±Ã»Óùý¡£ÕýºÃÏîÄ¿Àï»·¾³ÒªÓþÍÏëŪһ¸öÀ´ÍæÍ棬½á¹ûÏÖÔÚÈ˼Ò×îеÄÊÇCentOS£¬¾ÍÒ»ÕÅCD£¬ÆäËûµÄ¸ù¾ÝÐèÒª×Ô¼ºÉÏÍøDown£¬£¨ÎÒ²»Ï²»¶ÕâÑù×Ó¾Í×Ô¼ºÏÂÔØDVD°æ£©¡£°²×°ÍêÖ®ºóûÓÐͼÐνçÃ棬¶øÇÒûÓÐÌáʾÊäÈërootÃÜÂ룬»¹µÃµ½µ¥Óû§Ä£Ê½ÏÂÐ޸ġ£ºóÀ´ÏÂÔØÁËÒ»¸öͼÐÎ ......
Ê×ÏÈ¿´¿´ jspÎļþ java³ÌÐòÀïÓÐûÓÐrequest.setCharacterEncoding("UTF-8");
×Ö·û±àÂëÎÊÌ⣬Êý¾Ý²åÈë¿âÖÐʱ£¬java±àÂëºÍÊý¾Ý¿â±àÂë²»Ò»Ö£¬µ¼Ö²åÈëÊý¾Ý¿âΪÂÒÂ룬¿´µ½Îª£¿£¿£¿£¿µÄÐÎʽ
½«ÄãµÄjspÒ³Ãæ±àÂë¸ÄΪGBK£¬Êý¾Ý¿â¶ÔÓ¦±íµÄ±àÂëÒ²¸ÄΪGBK
±àÂëÒ»Ö£¬¾Í²»»á³öÏÖÂÒÂëÎÊÌâÁ ......
MYSQL°²×°
//½âѹ±àÒë°²×°
# tar xzvf mysql-5.0.27.tar.gz
# cd mysql-5.0.27
# ./configure -prefix=/home/redadmin/mysql
# make
# make install
# cd /home/redadmin/mysql/
# cp share/mysql/my-medium.cnf ./
# mv my-medium.cnf my.cnf
// my.confÎļþÐÞ¸Ä
# vi my.cnf
ÐÞ¸ÄÇ°£º
port &nb ......
import java.sql.*;
/*
* JAVAÁ¬½ÓACCESS£¬SQL Server,MySQL,OracleÊý¾Ý¿â
*
* */
public class JDBC {
public static void main(String[] args)throws Exception {
Connection conn=null;
//====Á¬½ÓACCESSÊý¾Ý¿â ......
Ç°Ì᣺MySQLÖдæÔÚÒ»¸öÓû§×Ô¼º½¨Á¢µÄÊý¾Ý¿â£¬¼ÙÉèΪmydb£¬mydbÖÐÓÐÒ»ÕÅÓû§×Ô¼º½¨Á¢µÄ±í¸ñ£¬¼ÙÉèÃû³ÆΪmytable
ÎÒµÄÇ°Ì᣺MySQLÖдæÔÚÁ½¸öÊý¾Ý¿â£¬yldbºÍyldb2£¬ÆäÖÐyldbÊý¾Ý¿âÖÐÓÐÒ»ÕÅ±í£¬ÃûΪpet
Ò».MYSQLµÄÃüÁîÐÐģʽµÄÉèÖãº
×ÀÃæ->ÎҵĵçÄÔ->ÊôÐÔ->»·¾³±äÁ¿->н¨->
PATH=“£»path\mysql\bin ......