我无法从derby包导入JDBC客户端驱动程序 [英] I can't import the JDBC Client Driver from the derby package
问题描述
我有一个在Netbeans中运行的Java Derby数据库,我正在尝试使用JDBC驱动程序连接到它.但是,我不能专门从org.apache.derby包导入JDBC驱动程序.
I have a Java Derby database running in Netbeans and I'm trying to connect to it using the JDBC driver. However, I cannot import the JDBC driver specifically from the org.apache.derby package.
我所做的:
-
我的pom.xml文件包含以下Maven存储库
My pom.xml file contains the following Maven repo's
<!-- https://mvnrepository.com/artifact/org.apache.derby/derby -->
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.15.1.3</version>
<type>jar</type>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.derby/derbyclient -->
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId>
<version>10.15.1.3</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbynet</artifactId>
<version>10.15.1.3</version>
</dependency>
-
Derby db属性表示数据库正在使用驱动程序您可以在此处看到
当尝试导入JDBC驱动程序时,它似乎是derby导入列表中唯一缺少的内容
When trying to import the JDBC driver, it is seemingly the only thing missing from the derby import list shown in this screenshot
我还下载了derby.jar文件,并将其直接复制到C:\ Program Files \ Java \ jdk8-221 \ bin
I have also downloaded the derby.jar file and copied it directly into C:\Program Files\Java\jdk8-221\bin
我真的不明白为什么缺少JDBC驱动程序.
I really can't understand why the JDBC driver specifically is missing.
推荐答案
我看到您正在使用10.15版.在此发行版中,Derby发行版在jar文件中的排列方式已更改,这可能会影响您.
I see that you are using release 10.15. In this release, the arrangement of the Derby distribution into jar files has changed, and this is probably affecting you.
请非常仔细地阅读 10.15发行说明,特别是请仔细查看"DERBY-6945的注意事项"部分,以获取有关如何更改类路径以访问Derby JDBC驱动程序类的详细信息.
Please read the 10.15 Release Notes very carefully, and in particular please carefully look at the section "Note for DERBY-6945" for the details of how you have to change your classpath to access the Derby JDBC driver classes.
可能您要做的就是包含
derbyshared.jar
.但是请阅读全文.Probably, all you have to do is to include
derbyshared.jar
. But please read the entire thing.这篇关于我无法从derby包导入JDBC客户端驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!