[英]com.microsoft.sqlserver.jdbc.SQLServerDriver class not found exception (NEW)
Now I am working with Microsoft SQLserver jdbc connectivity when I try to define class.forname 现在,当我尝试定义class.forname时,我正在使用Microsoft SQLserver jdbc连接性
java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
error occurs, everything else is fine, but I dint have any idea about this error. 错误发生,其他一切都很好,但是我对这个错误没有任何想法。
pom.xml: pom.xml:
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>4-2.0</version>
<scope>system</scope>
<systemPath>D:\my current work(please backup this folder)\backup\12-15-2016\milma_jishnu/src/main/lib/sqljdbc4-2.0.jar</systemPath>
</dependency>
Quoting Maven documentation : 引用Maven文档 :
System Dependencies 系统依赖
Important note: This is marked deprecated.
Dependencies with the scope system are always available and are not looked up in repository. 与作用域系统的依赖关系始终可用,不会在存储库中查找。 They are usually used to tell Maven about dependencies which are provided by the JDK or the VM. 它们通常用于告知Maven JDK或VM提供的依赖项。 Thus, system dependencies are especially useful for resolving dependencies on artifacts which are now provided by the JDK, but where available as separate downloads earlier. 因此,系统依赖关系对于解决JDK现在提供的工件的依赖关系特别有用,但以前可以单独下载获得。 Typical example are the JDBC standard extensions or the Java Authentication and Authorization Service (JAAS). 典型示例是JDBC标准扩展或Java身份验证和授权服务(JAAS)。
So, <scope>system</scope>
tells Maven: This is already present, you don't need to do anything. 因此, <scope>system</scope>
告诉Maven:这已经存在,您无需执行任何操作。
Ergo, it is not added to the classpath, and you wonder why it's not there? 嗯,它没有添加到类路径中,您想知道为什么它不存在吗?
Seems you misunderstood the purpose of <scope>system</scope>
. 似乎您误解了<scope>system</scope>
。 Don't use it, because the MS SQL JDBC driver is not part of the JDK. 不要使用它,因为MS SQL JDBC驱动程序不是JDK的一部分。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.