JAVA No suitable driver found for jdbc: microsoft: sqlserver: // localhost: 1433 / xxxxxx solution

jdbc:microsoft:sqlserver://localhost:1433/xxxxxx,

 

改成   jdbc:sqlserver://localhost:1368;DatabaseName=gdut_lib;

More than a "microsoft"; then I will remove this connection is successful; solution to this problem might have other;
in addition some places should also be noted:
1. The need to add sqljdbc4.jar or sqljdbc.jar (heard not both at the same time add, I just added a sqljdbc4.jar) Download: http: //www.microsoft.com/en-us/download/details.aspx displaylang = en & id = 11774?

conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433; databasename=test;user=sa;password=sa");
这里可以不要 microsoft
conn = DriverManager.getConnection("jdbc:sqlserver://localhost:1433; databasename=test;user=sa;password=sa");

发布了70 篇原创文章 · 获赞 1 · 访问量 521

Guess you like

Origin blog.csdn.net/zhupengqq1/article/details/103925624