String url="jdbc:microsoft:sqlserver://localhost:1433";
String user="sa"; 
String password=""; 
在数据库中给sa指定pubs即可

解决方案 »

  1.   

    你的mssql数据库服务器的端口可能不是1433,或者改变了
      

  2.   

    String url="jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=pubs"; 
    你的数据库是不是在本机上就有,IP别搞错。
      

  3.   

    thx!
    i was devasted by it through the all night.now,i have solved this fuck noising problem by myself,haheh.i gona http://www.microsoft.com/sql/ for refering to something valuable,and finnally i didn't radiculously upgrade my sql server to sp3....what a pity.and thx for the helper!and how to distribute the scores,give your opinion!
      

  4.   

    你有没有把JDBC驱动加进去了吗