¹ØÓÚSQLserverÁ¬½ÓµÄÎÊÌâ
ÎÒ×°ÁËSQLserver2000¡¢SQLserver2005ÕâÁ½¸öÊý¾Ý¿â£¬ÔõôÁ¬½ÓÕâÁ½¸öÊý¾ÝÄØ£¿£¨¿ª·¢¹¤¾ßΪmyEclipse£©
ÎÒÓÃJDBCÁ¬½ÓÉÏÁËSQLserver2005,¼ÓÈëÁËÈý¸öÇý¶¯°ü(Ìý˵ÕâÈý¸öÇý¶¯ÊÇÓÃÓÚÁ¬½ÓSQLserver2000µÄ)£¬Çý¶¯ÃûΪcom.microsoft.jdbc.sqlserver.SQLServerDriver£¬½á¹ûÁ¬½ÓÉÏÁË
Èç¹ûÎÒÏëÁ¬½ÓSQLserver2000ÔõôÁ¬ÄØ£¿Çý¶¯ÓÃʲô£¿
PS£º±¾È˳õѧÕߣ¬Çë½ÌÁ¬½ÓÊý¾Ý¿âÓм¸ÖÖ·½Ê½ÄØ£¿
2000 or 2005µÄÁ´½Ó¼Ü°ü£¬Ä㶼¿ÉÒÔֻʹÓÃSQL2005µÄÁ´½Ó¼Ü°ü£¬Ö»ÐèÒªÒ»¸ö¼´¿É£¡sqljdbc.jar
Çý¶¯²»Í¬£¬¼ÓÔØÇý¶¯Ê±Ò²ÓÐЩ²»Í¬£º
2005£º
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Á¬¿â×Ö·û´®"jdbc:sqlserver://localhost:1433;databaseName=**"
2000:
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Á¬½Ó×Ö·û´®"jdbc:microsoft:sqlserver://localhost:1433;databaseName=**"
ͬʱ°²×°SQLserver2000¡¢SQLserver2005ÕâÁ½¸öÊý¾Ý¿âµÄʱºò£¬Òª×¢ÒâÁ½¸öÊý¾Ý¿âÊǵĶ˿ںŲ»ÄÜÏàͬ£¬
Çø·ÖSQLserver2000»¹ÊÇSQLserver2005
JDBCÁ´½ÓSQLserverʱºò¿ÉÒÔ¸ù¾Ý¶Ë¿Ú²»Í¬À´Çø·Ö
2Â¥Õý½â£¡£¡£¡£¡£¡£¡
¸øµã·Ö°É
ÎÒ¶¥Äã
»Ø¸´ÄÚÈÝÌ«¶ÌÁË
2005£º
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Á¬¿â×Ö·û´®"jdbc:sqlserver://localhost:1433;databaseName=**"
2000:
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Á¬½
Ïà¹ØÎÊ´ð£º
import java.sql.Connection;
import java.sql.Date;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class QueryTest&n ......
ÔÚÊý¾Ý¿âÖÐÓÐÕÅ±í£¬ÓÐid,nameÁ½ÁУ¬id ÊÇÖ÷¼ü,ûÓÐÉèÖÃ×ÔÔöÊôÐÔ,ÔÚ³ÌÐòÖÐÈ¡³öÕâÕűí·ÅÈëdatatable£¬ÔÚÕâ¸ödatatableÖвåÈëÒ»Ìõ¼Ç¼£¬µ±¸üÐÂÊý¾Ý¿âʱÌáʾidÁв»ÄÜΪ¿Õ£¬ÇëÎʸÃÔõô½â¾ö£¿
¸øËüÒ»¸öÖµ£¡£¡Ö÷¼ü²»ÄÜΪ¿Õ ......
Ҫת³ÉÒ»ÑùµÄЧ¹û£¬ÓÃpowerdesignerÔõôת£¿ÄÜתÂð£¿
create table publishers (
publisherID int identity,
publisherName varchar (30) NOT NULL,
constraint pk_publishers primary key (publisherID)
)& ......
ÈçºÎ½«SqlServerÊý¾Ý¿âÖеÄÊý¾Ýµ¼Èëµ½ExcelÖУ¿
ÓÃsql server ×Ô´øµÄ¹¤¾ß
ÒýÓÃ
ÓÃsql server ×Ô´øµÄ¹¤¾ß
SQL²éѯ·ÖÎöÆ÷
DTSµ¼Èëµ¼³öÊý¾Ý
¿ÉÒÔÓÃSqlServer×Ô´øµÄ¹¤¾ß
ËùÓÐÈÎÎñ£µ¼³öÊý¾Ý¡£
ÄãÏÈÓòéÑ ......
ÎҼǵÃsqlserverÖÐÓдúÂë¿ÉÒÔÖ±½Ó´´½¨Ò»¸öÓû§µÄ£¬ÇëÄÄλָµãÏ£¡
ºÃÏñÒªÓõ½xp_cmdshellÀ´´´½¨windowsÓû§£¬¾ßÌåµÄÄã¿ÉÒÔgoogleÒ»ÏÂ
ÄãÁ¬ÉϵÄÓû§Èç¹ûÄÜÓÃxp_cmdshellµÄ»°£¬¾ÍÓðɡ£
xp_cmdshell 'n ......