com.microsoft.sqlserver.jdbc.SQLServerDriver not found error

前端 未结 8 1834
暖寄归人
暖寄归人 2021-02-13 14:56

I am trying to connect to my SQL Server 2008 database from Java and I\'m having the same problem from this thread.

String userName = \"xxxx\";
String password =          


        
8条回答
  •  抹茶落季
    2021-02-13 15:08

    You dont need both jTDS and JDBC in your classpath. Any one is required. Here you need only sqljdbc.jar.

    Also, I would suggest to place sqljdbc.jar at physical location to /WEB-INF/lib directory of your project rather than adding it in the Classpath via IDE. Then Tomcat takes care the rest. And also try restarting Tomcat.

    You can download Jar from : www.java2s.com/Code/JarDownload/sqlserverjdbc/sqlserverjdbc.jar.zip

    EDIT:

    As you are supplying Username and Password when connecting,

    You need only jdbc:sqlserver://localhost:1433;databaseName=test, Skip integratedSecurity attribute.

提交回复
热议问题