JSP connection solution for SQL Server 2008 not connected _jsp programming

Source: Internet
Author: User

1, first is if you encounter javax.servlet.ServletException:java.lang.ClassNotFoundException: Com.microsoft.jdbc.sqlserver.SQLServerDriver this error,

Then presumably you should put Class.forName ("Com.microsoft.jdbc.sqlserver.SQLServerDriver");

Changed into Class.forName ("Com.microsoft.sqlserver.jdbc.SQLServerDriver");

2, when the error for the Javax.servlet.ServletException:java.sql.SQLException:No suitable driver found for jdbc:microsoft:sqlserver:// When Localhost:1034;databasename=test2,

String url= should be "jdbc:microsoft:sqlserver://localhost:1034;databasename=test2";

Changed to String url= "Jdbc:sqlserver://localhost:1034;databasename=test2";

3, error is javax.servlet.ServletException:com.microsoft.sqlserver.jdbc.SQLServerException: Unable to open login requested database "Test2". Login failed.

There are many solutions to this problem online, such as checking drivers, user rights, and so on, I repeatedly to create users, set permissions, has not been successful. Finally I was in the Configuration Manager, check the network configuration of TCP/IP ipall dynamic port, found that he is not the usual 1433, but 1034, and then changed in the code, just fine ... In addition, the user rights in SQL Server should be noted, otherwise it is easy to problem

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.