¿ìËٸ㶨ÔÚEclipseÖÐÓÃJDBCÁ¬½ÓSQL Server 2005
1¡¢ÏÂÔرر¸Èí¼þ
(1) JDK (Java Development Kit)
SUN¹Ù·½µÄÏÂÔصØÖ·ÊÇhttp://java.sun.com/javase/downloads/index.jsp
(2) JDBC
(3) Eclipse
(4) Microsoft SQL Server 2005 Express£¨µ±È»£¬ÓзÇExpressÒ²OK°¡£©
(5) SQL Server Management Studio
2¡¢°²×°Óë»·¾³ÅäÖÃ
(1) JDK
Ê×ÏÈÔÚWindows»·¾³Ï£¬ÏÂÔغó°²×°¼´¿É¡£
È»ºóÔÚÎҵĵçÄÔ-ÊôÐÔ-¸ß¼¶ÏµÍ³ÉèÖÃ-¸ß¼¶-»·¾³±äÁ¿-ϵͳ±äÁ¿£º
1¡¢“н¨”£º±äÁ¿ÃûΪJAVA_HOME£¬±äÁ¿ÖµÎªJDKµÄ¸ùĿ¼¡£
2¡¢“н¨”£º±äÁ¿ÃûΪCLASSPATH£¬±äÁ¿ÖµÎª%JAVA_HOME%\lib
3¡¢“н¨”£º±äÁ¿ÃûΪPATH£¬±äÁ¿ÖµÎª%JAVA_HOME%\bin
×¢Ò⣺Èç¹û±äÁ¿ÃûÒѾ´æÔÚ£¬ÔòÑ¡Ôñ“±à¼”£¬ÔÚ±äÁ¿ÖµµÄ×îºó¼ÓÉÏ“;”£¨·ÖºÅ£©£¬²¢ÔڷֺźóÃæÊäÈëÉÏÃæËùÊöµÄ±äÁ¿Öµ¡£
×îºó±ðÍüÁ˵ã“È·¶¨”¡£ÏÖÔھͿÉÒÔÔÚÃüÁîÐÐÖÐʹÓÓjavac”ÁË¡£
(2) JDBC
ÏÂÔغó½âѹ£¬ÔÚ°²×°Ä¿Â¼ÕÒµ½sqljdbc.jar£¨×¢Ò⣬Ä㻹»áÕÒµ½Ò»¸ösqljdbc4.jar£¬¿¼Âǵ½ÓеÄjre°æ±¾µÍµÄÇé¿ö£¬Ö»ÓÃsqljdbc.jar£¬²»ÓÃsqljdbc4.jar£©¡£
¼ÆËã»ú->ÊôÐÔ->¸ß¼¶->»·¾³±äÁ¿->ϵͳ±äÁ¿->classpath×îºó×·¼ÓÕâ¸ösqljdbc.jar£¬Ò»¶¨ÒªÐ´ÍêÕûµÄ·¾¶£¬´ÓÅÌ·û¿ªÊ¼¡£
Ñ¡ÔñÈ·¶¨¡£
(3) SQL Server Configuration Management
¿ªÊ¼->³ÌÐò->Microsoft SQL Server 2005->SQL Server Configuration Management
->SQLEXPRESSµÄÐÒé->ÓÒ¼üTCP/IP£¬Ñ¡ÔñÆô¶¯£»
->SQLEXPRESSµÄÐÒé->Ë«»÷TCP/IP£¬°ÑIPµØÖ·Ñ¡ÏÖеÄIPALLÖеÄTCP¶Ë¿ÚÉèÖÃΪÄãËùÏëÒªÉèÖõĶ˿ڣ¬Èç1433£»
ÖØÐÂÆô¶¯SQL Server·þÎñ
¹Ø±ÕSQL Server Configuration Management
(4) SQL Server Management Studio
н¨Êý¾Ý¿â£¬Ãû³Æ¿É¶¨Îªsample
(5) Eclipse
File->New->java project£¬Ãû³Æ×Ô¶¨£»
Window->Preferences->Java->Installed JREs->Ñ¡Ôñjre6->Edit->Add Extenal JARs->Ñ¡Ôñsqljdbc.jarµÄλÖá£
3¡¢²Î¿¼×ÊÁÏ£º
¡¾1¡¿http://wenku.baidu.com/view/19967d1b6bd97f192279e9a5.html
¡¾2¡¿http://blog.csdn.net/Poechant/archive/2010/05/31/5635542.aspx
¡¾3¡¿http://blog.sina.com.cn/s/blog_5ccc0a650100he46.html
¡¾4¡¿http://blog.csdn.net/downmoon/archive/2009/07/16/4352914.aspx
Ïà¹ØÎĵµ£º
¾³£»á¿´¼ûÔÚSQL³ÌÐòµÄ¿ªÍ·ÓÐÕâÑùÒ»¾ä»°
if OBJECT_ID('tb') is not null
drop table tb
º¯ÊýÓï·¨ÊÇÕâÑù£º
int OBJECT_ID('objectname');
×÷ÓÃÊÇ¿´¶ÔÏóobjectnameÊÇ·ñ´æÔÚ¡£
ÆäÖвÎÊýobjectname±íʾҪʹÓõĶÔÏó£¬ÊÇchar»òÕßncharÀàÐÍ¡£
·µ»ØÖµÀàÐÍΪint£¬Èç¹û¶ÔÏó´æÔÚ£¬Ôò·µ»Ø´Ë¶ÔÏóÔÚϵͳÖеı ......
Ò»¡¢SQL´æ´¢¹ý³ÌµÄ¸ÅÄÓŵ㼰Óï·¨
¡¡¡¡ÕûÀíÔÚѧϰ³ÌÐò¹ý³Ì֮ǰ£¬ÏÈÁ˽âÏÂʲôÊÇ´æ´¢¹ý³Ì?ΪʲôҪÓô洢¹ý³Ì£¬ËûÓÐÄÇЩÓŵã
¡¡¡¡¶¨Ò壺½«³£ÓõĻòºÜ¸´ÔӵŤ×÷£¬Ô¤ÏÈÓÃSQLÓï¾äдºÃ²¢ÓÃÒ»¸öÖ¸¶¨µÄÃû³Æ´æ´¢ÆðÀ´, ÄÇôÒÔºóÒª½ÐÊý¾Ý¿âÌṩÓëÒѶ¨ÒåºÃµÄ´æ´¢¹ý³ÌµÄ¹¦ÄÜÏàͬµÄ·þÎñʱ,Ö»Ðèµ÷ÓÃexecute,¼´¿É×Ô¶¯Íê³ ......
ÔÚSQL Server 2005 Express Éϸ½¼Ó´ÓÁíÍâһ̨µçÄÔCopy¹ýÀ´µÄÊý¾Ý¿âºó£¬Êý¾Ý¿âΪ“Ö»¶Á”¡£
½â¾ö°ì·¨£º
´ò¿ª SQL Server Configuration Manager, ´ò¿ªSQL Server SQLEXPRESS µÄÊôÐÔ
ÔÚÄÚÖÃÕʺŴ¦£¬°Ñ“ÍøÂç·þÎñ”¸Ä³É“±¾µØϵͳ”£¬ÖØÐÂÆô¶¯SQL Server 2005 Express ºó£¬ÔÙ¸½¼ÓÊý¾Ý ......
http://www.sql-server-performance.com/tips/clustered_indexes_p1.aspx
As a rule of thumb, every table should have a clustered index. Generally, but not always, the clustered index should be on a column that monotonically increases--such as an identity column, or some other column where the value is ......
'SQL·À×¢È뺯Êý£¬µ÷Ó÷½·¨£¬ÔÚÐèÒª·À×¢ÈëµÄµØ·½Ìæ»»ÒÔÇ°µÄrequest("XXXX")ΪSafeRequest("XXXX")
'www.yongfa365.com
Function
SafeRequest(ParaValue)
ParaValue =
Trim
(
Request
(Pa ......