jspÁ¬½Ósql server2005
jspÁ¬½Ósql server2005
£¨¾²âÊÔÁ¬½Ó³É¹¦£©
½Ó´¥Java»òÕßJSP£¬ÄÑÃâ»áʹÓõ½Êý¾Ý¿â
SQL Server
2000/2005£¨ÎÒʹÓÃ2005±ê×¼°æ[9.0.3054]²âÊÔ£©£¬¾¹ý×Ô¼ºµÄËÑË÷ºÍÑо¿£¬Ê¹ÓÃJDBCÁ¬½ÓSQL
Server³É¹¦£¬ÌØ´ËÕûÀí·½·¨£¨Ê¹ÓÃEclipse 3.2£©ÈçÏ¡£
×¼±¸¹¤×÷
Ê×ÏÈ£¬²Ù×÷ϵͳ
Öа²×°ºÃSQL Server
2000/2005£¬Èç¹ûϵͳÖж¼×°ÓÐ2000ºÍ2005°æ£¬¼ÇµÃÍ£ÓÃÒ»¸ö£¬Ö»¿ªÒ»¸öÐÐÁË¡£
È»ºó£¬µ½Î¢ÈíÍøÕ¾ÏÂÔØ
Microsoft SQL Server 2005 JDBC
Driver 1.1
£¬Ò²¿ÉÒÔʹÓÃÕâ¸öµØÖ·
Ö±½ÓÏÂÔØ
¡£
½âѹsqljdbc_1.1.1501.101_chs.exe£¬°Ñsqljdbc_1.1¸´ÖƵ½%ProgramFiles%£¨Èç¹ûϵͳÔÚCÅÌÔòΪ
C:\Program Files£©¡£
ÉèÖÃ Classpath
JDBC Çý¶¯³ÌÐò²¢Î´°üº¬ÔÚ Java SDK ÖС£Òò´Ë£¬Èç¹ûҪʹÓøÃÇý¶¯³ÌÐò£¬±ØÐ뽫 classpath ÉèÖÃΪ°üº¬ sqljdbc.jar
Îļþ¡£Èç¹û classpath ȱÉÙ sqljdbc.jar ÏӦÓóÌÐò½«Òý·¢“ÕÒ²»µ½Àà”µÄ³£¼ûÒì³£¡£
sqljdbc.jar ÎļþµÄ°²×°Î»ÖÃÈçÏ£º
°²×°Ä¿Â¼>\sqljdbc_°æ±¾>\ÓïÑÔ>\sqljdbc.jar
ÏÂÃæÊÇÓÃÓÚ Windows
Ó¦ÓóÌÐòµÄ CLASSPATH
Óï¾äʵÀý£º
CLASSPATH =.;%ProgramFiles%\sqljdbc_1.1\chs\sqljdbc.jar
ÏÂÃæÊÇÓÃÓÚ Unix/Linux Ó¦ÓóÌÐòµÄ CLASSPATH Óï¾äʵÀý£º
CLASSPATH
=.:/home/usr1/mssqlserver2005jdbc/Driver/sqljdbc_1.1/chs/sqljdbc.jar
×¢Ò⣺
ÔÚ Window ϵͳÖУ¬Èç¹ûĿ¼Ãû³¤ÓÚ 8.3 »òÎļþ¼ÐÃûÖаüº¬¿Õ¸ñ£¬½«µ¼Ö classpath
³öÏÖÎÊÌâ¡£Èç¹û»³ÒÉ´æÔÚÕâÀàÎÊÌ⣬ӦÔÝʱ½« sqljdbc.jar ÎļþÒƶ¯µ½Ãû³Æ¼òµ¥µÄĿ¼ÖУ¬ÀýÈç C:\Temp£¬¸ü¸Ä
classpath£¬È»ºó²âÊÔÕâÑùÊÇ·ñ½â¾öÁËÎÊÌâ¡£
Ö±½ÓÔÚÃüÁîÌáʾ·ûÔËÐеÄÓ¦ÓóÌÐò
ÔÚ²Ù×÷ϵͳÖÐÅäÖà classpath¡£½« sqljdbc.jar ×·¼Óµ½ÏµÍ³µÄ classpath ÖС£»òÕߣ¬Ê¹Óà java
-classpath
Ñ¡Ï¿ÉÒÔÔÚÔËÐдËÓ¦ÓóÌÐòµÄ Java ÃüÁîÐÐÉÏÖ¸¶¨ classpath¡£
ÉèÖÃSQL Server·þÎñÆ÷
ÎÒʹÓõÄÊÇSQL Server 2005±ê×¼°æSP2£¬ÕâЩ¶¼Ä¬Èϼ´¿É£¬Ò»°ã²»ÓÃÅäÖá£Èç¹ûÐèÒªÅäÖö˿ÚÇë¿´ÏÂÃæ¡£
1¡¢“¿ªÊ¼”→“³ÌÐò”→“Microsoft SQL Server 2005”→“ÅäÖù¤¾ß”→“SQL Server ÅäÖùÜÀí
Æ÷”→“SQL Server 2005 ÍøÂç
ÅäÖÔ→“MSSQLSERVER µÄÐÒé”
2¡¢Èç¹û“TCP/IP”ûÓÐÆôÓã¬ÓÒ¼üµ¥»÷Ñ¡Ôñ“Æô¶¯”¡£
3¡¢Ë«»÷“TCP/
Ïà¹ØÎĵµ£º
ÊéÇ©£ºÇå³ýËùÓÐÊéÇ©¡£ CTRL-SHIFT-F2
ÊéÇ©£º²åÈë»òɾ³ýÊéÇ©(Çл»)¡£ CTRL+F2
ÊéÇ©£ºÒƶ¯µ½ÏÂÒ»¸öÊéÇ©¡£ F2 ¹¦Äܼü
ÊéÇ©£ºÒƶ¯µ½ÉÏÒ»¸öÊéÇ©¡£ SHIFT+F2
È¡Ïû²éѯ¡£ ALT+BREAK
Á¬½Ó£ºÁ¬½Ó¡£ CTRL+O
Á¬½Ó£º¶Ï¿ªÁ¬½Ó¡£ CTRL+F4
Á¬½Ó£º¶Ï¿ªÁ¬½Ó²¢¹Ø±Õ×Ó´°¿Ú¡£ CTRL+F4
Êý¾Ý¿â¶ÔÏóÐÅÏ¢¡£ ALT+F1
±à¼£ºÇå³ý»î¶¯ ......
--È«²¿µÄ¼ò·±¶ÔÕÕ
declare @jall nvarchar(4000),@fall nvarchar(4000)
select @jall=N'°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°°®°¯°°°±°²°³°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ±¡±¢±£±¤±¥±¦±§±¨±©±ª±«±¬±±® ......
select c0501 "¶©µ¥±àºÅ",
c0503 "¹©Ó¦É̱àÂë",a0302 "¹©Ó¦ÉÌÃû³Æ",
to_char(c0515,'yyyy.mm.dd') "¶©»õÈÕÆÚ",
to_char(c0516,'yyyy.mm.dd') "Ô¤¶¨½»»õÈÕÆÚ"
from c05,a03 where c0503=a0301 and
&nb ......
½éÉÜ
ÎÒÃÇÒ»ÆðÀ´×ö¸öʾÀý£¬ÔÚ.NETÖÐн¨Ò»¸öÀ࣬²¢ÔÚÕâ¸öÀàÀïн¨Ò»¸ö·½·¨£¬È»ºóÔÚSQL ServerÖе÷ÓÃÕâ¸ö·½·¨¡£°´ÕÕ΢ÈíËùÊö£¬Í¨¹ýËÞÖ÷ Microsoft .NET Framework 2.0 ¹«¹²ÓïÑÔÔËÐпâ (CLR)£¬SQL Server 2005ÏÔÖøµØÔöÇ¿ÁËÊý¾Ý¿â±à³ÌÄ£ÐÍ¡£ ÕâʹµÃ¿ª·¢ÈËÔ±¿ÉÒÔÓÃÈκÎCLRÓïÑÔ£¨ÈçC#¡¢VB.NET»òC++µÈ£©À´Ð´´æ´¢¹ý³Ì¡¢´¥·¢Æ÷ºÍÓ ......
1.ÅжÏÒ»¸öÁÙʱ±íÊÇ·ñ´æÔÚ
if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#tempcitys') and type='U')
drop table #tempcitys
×¢ÒâtempdbºóÃæÊÇÁ½¸ö. ²»ÊÇÒ»¸öµÄ
---ÁÙʱ±í
if exists(select * from tempdb..sysobjects where name like &lsqu ......