com.microsoft.sqlserver.jdbc.SQLServerDriver class 未找到异常(新)
com.microsoft.sqlserver.jdbc.SQLServerDriver class not found exception (NEW)
现在,当我尝试定义 class.forname
时,我正在使用 Microsoft SQLserver jdbc 连接
java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
发生错误,
其他一切都很好,但我不知道这个错误。
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-15-2016\milma_jishnu/src/main/lib/sqljdbc4-2.0.jar</systemPath>
</dependency>
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. 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. Typical example are the JDBC standard extensions or the Java Authentication and Authorization Service (JAAS).
所以,<scope>system</scope>
告诉 Maven:这已经存在,你不需要做任何事情。
因此,它没有 添加到类路径中,您想知道为什么它不存在吗?
您似乎误解了 <scope>system</scope>
的目的。不要使用它,因为 MS SQL JDBC 驱动程序不是 JDK.
的一部分
现在,当我尝试定义 class.forname
时,我正在使用 Microsoft SQLserver jdbc 连接java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
发生错误, 其他一切都很好,但我不知道这个错误。
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-15-2016\milma_jishnu/src/main/lib/sqljdbc4-2.0.jar</systemPath>
</dependency>
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. 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. Typical example are the JDBC standard extensions or the Java Authentication and Authorization Service (JAAS).
所以,<scope>system</scope>
告诉 Maven:这已经存在,你不需要做任何事情。
因此,它没有 添加到类路径中,您想知道为什么它不存在吗?
您似乎误解了 <scope>system</scope>
的目的。不要使用它,因为 MS SQL JDBC 驱动程序不是 JDK.