使用JDBC连接到MS SQLServer时发生ClassNotFoundException [英] ClassNotFoundException when connecting to MS SQLServer using JDBC
问题描述
我正在尝试使用MS JDBC驱动程序(Microsoft SQL Server JDBC驱动程序3.0:
I'm trying to connect to a MSSQL using the MS JDBC Driver (Microsoft SQL Server JDBC Driver 3.0: http://www.microsoft.com/download/en/details.aspx?id=21599) but what every i do i get java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver when i run the project in Netbeans.
我正在Windows 7 Enterprise 64位上运行Netbeans 7.1.我在网络上浏览了很多指南,了解如何设置MSSQL JDBC驱动程序,但是我知道我缺少一些东西.有没有人提供有关此设置的傻瓜/傻瓜指南,我不在乎它的基础.我确信在我的环境中它是不正确的,我只是从Java和Netbeans开始,所以我怀疑我忽略了某些东西.
I am running Netbeans 7.1 on Windows 7 Enterprise 64-bit. I have gone through quite a few guides on the web on how to setup the MSSQL JDBC driver but I know I'm missing something. Does anyone have a fool/idiot proof guide to setting this up, I don't care how basic it is. I'm sure its something in my enviroment that isn't correct and I'm only just starting out with Java and Netbeans so I suspect I've overlooked something.
推荐答案
SQLServerDriver类的软件包可能不正确.尝试使用"com.microsoft.sqlserver.jdbc.SQLServerDriver"而不是"com.microsoft.jdbc.sqlserver.SQLServerDriver".
You might have the package for the SQLServerDriver class incorrect. Try "com.microsoft.sqlserver.jdbc.SQLServerDriver" instead of "com.microsoft.jdbc.sqlserver.SQLServerDriver".
这篇关于使用JDBC连接到MS SQLServer时发生ClassNotFoundException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!