javaÁ´½Ósql server
ÔÌû¼°ÌÖÂÛ£ºhttp://bbs.bc-cn.net/dispbbs.asp?boardid=12&id=140292
* ×î½üÒòΪ¿ª·¢»î¶¯ÐèÒª,ÓÃÉÏÁËEclipse,²¢ÒªÇóʹÓþ«¼ò°æµÄSQLÊý¾Ý¿â(¼´SQL Server 2005)À´½øÐпª·¢ÏîÄ¿ *
1.×¼±¸¹¤×÷: ×¼±¸Ïà¹ØµÄÈí¼þ(Eclipse³ýÍâ,¿ªÔ´Èí¼þ¿ÉÒÔ´Ó¹ÙÍøÏÂÔØ)
<1> .Microsoft SQL Server 2005 Express Edition
ÏÂÔصØÖ·:http://download.microsoft.com/download/0/9/0/09020fab-d2c3-4a8c-b9e0-db53a7a30ae8/SQLEXPR_CHS.EXE
<2> .SQL Server Management Studio
ÏÂÔصØÖ·:http://www.microsoft.com/downloads/details.aspx?displaylang=zh-cn&FamilyID=c243a5ae-4bd1-4e3d-94b8-5a0f62bf7796#filelist
<3> .SQL Server 2005 driver for JDBC
ÏÂÔصØÖ·:http://download.microsoft.com/download/8/B/D/8BDABAE2-B6EA-41D4-B903-7916EF3690EF/sqljdbc_1.2.2323.101_enu.exe
2.¶¼ÏÂÔØÍêÖ®ºó¿ªÊ¼½øÐа²×° ,Ç°Á½¸öÊÇÊôÓÚÊý¾Ý¿âÈí¼þ,Õý³£°²×°¼´¿É(×¢ÒâÊý¾Ý¿âµÇ½²»ÒªÊ¹ÓÃwindowsÑéÖ¤)
<1> ½«JDBC½âѹËõµ½ÈÎÒâλÖÃ,±ÈÈç½âѹµ½CÅÌprogram filesÏÂÃæ,²¢ÔÚ°²×°Ä¿Â¼ÀïÕÒµ½sqljdbc.jarÎļþ,µÃµ½Æä·¾¶¿ªÊ¼ÅäÖû·¾³±äÁ¿
ÔÚ»·¾³±äÁ¿classpath ºóÃæ×·¼Ó C:\Program Files\Microsoft SQL Server2005 JDBC Driver\sqljdbc_1.2\enu\sqljdbc.jar
<2> ÉèÖÃSQLEXPRESS·þÎñÆ÷:
a.´ò¿ªSQL Server Configuration Manager -> SQLEXPRESSµÄÐÒé -> TCP/IP
b.ÓÒ¼üµ¥»÷Æô¶¯TCP/IP
c.Ë«»÷½øÈëÊôÐÔ,°ÑIPµØÖ·ÖеÄIP allÖеÄTCP¶Ë¿ÚÉèÖÃΪ1433
d.ÖØÐÂÆô¶¯SQL Server 2005·þÎñÖеÄSQLEXPRESS·þÎñÆ÷
e.¹Ø±ÕSQL Server Configuration Manager
<3> ´ò¿ª¸Õ¸Õ°²×°ºÃµÄ SQL Server Management Studio,Á¬½ÓSQLEXPRESS·þÎñÆ÷, н¨Êý¾Ý¿â,ÆðÃû×ÖΪsample
<4> ´ò¿ªEcl
Ïà¹ØÎĵµ£º
sql º¯Êý×ܽá
³£ÓõÄ×Ö·û´®º¯ÊýÓУº
Ò»¡¢×Ö·ûת»»º¯Êý
1¡¢ASCII()
·µ»Ø×Ö·û±í´ïʽ×î×ó¶Ë×Ö·ûµÄASCII ÂëÖµ¡£ÔÚASCII£¨£©º¯ÊýÖУ¬´¿Êý×ÖµÄ×Ö·û´®¿É²»ÓÑ’À¨ÆðÀ´£¬µ«º¬ÆäËü×Ö·ûµÄ×Ö·û´®±ØÐëÓÑ’À¨ÆðÀ´Ê¹Ó㬷ñÔò»á³ö´í¡£
2¡¢CHAR()
½«ASCII Âëת»»Îª×Ö·û¡£Èç¹ûûÓÐÊäÈë0 ~ 255 Ö®¼äµÄASCII ......
SQLÓÅ»¯34Ìõ
ÎÒÃÇÒª×öµ½²»µ«»áдSQL,»¹Òª×öµ½Ð´³öÐÔÄÜÓÅÁ¼µÄSQL,ÒÔÏÂΪ±ÊÕßѧϰ¡¢ÕªÂ¼¡¢²¢»ã×ܲ¿·Ö×ÊÁÏÓë´ó¼Ò·ÖÏí£¡
£¨1£© Ñ¡Ôñ×îÓÐЧÂʵıíÃû˳Ðò(Ö»ÔÚ»ùÓÚ¹æÔòµÄÓÅ»¯Æ÷ÖÐÓÐЧ)£º
ORACLE µÄ½âÎöÆ÷°´ÕÕ´ÓÓÒµ½×óµÄ˳Ðò´¦Àífrom×Ó¾äÖеıíÃû£¬from×Ó¾äÖÐдÔÚ×îºóµÄ±í(»ù´¡±í driving tabl ......
ÔÎĵØÖ·£ºhttp://www.dingos.cn/index.php?topic=1688.0
OracleÓÐrownumÓÃÓÚ·ÃÎʱíÖÐÐкš£ÄÇôÔÚSQL ServerÖÐÊÇ·ñÓеÈЧµÄÄØ£¿»òÕßÔÚSQL ServerÖÐÈçºÎÊä³öÐкţ¿
-----------------------------------
ÔÚSQL ServerÖÐûÓÐÖ±½ÓµÈЧÓÚOracleµÄrownum
-----------------------------------
Ñϸñ˵À´£¬ÔÚ¹ØϵÊý¾Ý¿âÖУ¬± ......
ÈçºÎÉú³Éexplain plan?
¡¡¡¡½â´ð:ÔËÐÐutlxplan.sql. ½¨Á¢plan ±í
¡¡¡¡Õë¶ÔÌض¨SQLÓï¾ä£¬Ê¹Óà explain plan set statement_id = 'tst1' into plan_table
¡¡¡¡ÔËÐÐutlxplp.sql »ò utlxpls.sql²ì¿´explain plan
EXPLAIN PLAN ÊÇÒ»¸öºÜºÃµÄ·ÖÎöSQLÓï¾äµÄ¹¤¾ß,ËüÉõÖÁ¿ÉÒÔÔÚ²»Ö´ÐÐSQLµÄÇé¿öÏ·ÖÎöÓï¾ä. ͨ¹ý·ÖÎö,ÎÒÃǾͿÉÒÔÖ ......
תÔØ×Ô:http://www.diybl.com/course/7_databases/sql/sqlServer/2009124/154621_2.html
Ò»¸öÌâÄ¿Éæ¼°µ½µÄ50¸öSqlÓï¾ä
Student(S#,Sname,Sage,Ssex) ѧÉú±í
Course(C#,Cname,T#) ¿Î³Ì±í
SC(S#,C#,score) ³É¼¨±í
Teacher(T#,Tname) ½Ìʦ±í
ÎÊÌ⣺
1¡¢²éѯ“001”¿Î³Ì±È“002”¿Î³Ì³É¼¨¸ßµÄ ......