1,首先,如果你遇到javax.servlet.servletexception错误:java.lang.classnotfoundexception:com.microsoft.jdbc.sqlserver.sqlserverdriver,

所以你应该觉得Class.forName(COM。微软。JDBC。SQLServer。sqlserverdriver );

改变Class.forName(COM。微软。SQLServer JDBC。sqlserverdriver );

2,当误差报的错是难道是没有合适的驱动程序发现JDBC:微软:: / /本地SQLServer 1034数据库= test2。

字符串URL =JDBC:微软SQLServer: / /:本地:1034;DatabaseName& = test2应采取。

更改字符串URL =JDBC: / /本地SQLServer::1034;DatabaseName& = test2 ;

3、错误报的错是COM。微软。SQLServer JDBC。sqlserverexception:,无法打开请求的登录数据库,个的登录失败。

解决这个问题的方法有很多,比如检查驱动、用户权限等。I repeatedly create users and set permissions, and have not been able to succeed.Finally, I went to the configuration manager to check the dynamic port of TCP/IP's IPALL in the network configuration, and found that he was not the usual 1433, but 1034, and then changed it in the code.In addition, the user rights in SQL server should be paid attention to, otherwise it is easy to get the problem