ClassNotFoundException when connecting to MS SQLServer using JDBC

I am trying to connect to MSSQL using the MS JDBC driver (Microsoft SQL Server JDBC Driver 3.0: http://www.microsoft.com/download/en/details.aspx?id=21599 ), but that everyone I get java.lang. ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver when I run the project in Netbeans.

I am running Netbeans 7.1 on Windows 7 Enterprise 64-bit. I have looked through several guides on the Internet on how to configure the MSSQL JDBC driver, but I know that something is missing. Does anyone have a guide for fool / idiocy to set this up, I don't care how important this is. I am sure that this is something in my environment, it is not right, and I am just starting with Java and Netbeans, so I suspect that I did not notice something.

+4
source share
3 answers

You may have the wrong package for the SQLServerDriver class. Try "com.microsoft.sqlserver.jdbc.SQLServerDriver" instead of "com.microsoft.jdbc.sqlserver.SQLServerDriver".

+6
source

I have a panel of your project tree, in libraries, if a JDBC list is specified, if you do not right-click on the node library → Add JAR / Folder. Then view the package you need from your computer and import it. I think this should solve the problem.

And as you requested this link, it might be useful to create a simple application using the MYSQL database

+3
source

In NETBEANS add the path in the project properties → libraries → the compilation tab of the screen image → [ http://i.stack.imgur.com/g6BH3.jpg]

0
source

Source: https://habr.com/ru/post/1397960/


All Articles