简体   繁体   English

我无法从 derby package 导入 JDBC 客户端驱动程序

[英]I can't import the JDBC Client Driver from the derby package

I have a Java Derby database running in Netbeans and I'm trying to connect to it using the JDBC driver.我有一个 Java Derby 数据库在 Netbeans 中运行,我正在尝试使用 JDBC 驱动程序连接到它。 However, I cannot import the JDBC driver specifically from the org.apache.derby package.但是,我无法专门从 org.apache.derby package 导入 JDBC 驱动程序。

What I've done:我做了什么:

  • My pom.xml file contains the following Maven repo's我的 pom.xml 文件包含以下 Maven 回购

    <:-- 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>
    • The Derby db properties says the database is using the driver as you can see here Derby db 属性表示数据库正在使用驱动程序,如您在此处看到的

    • When trying to import the JDBC driver, it is seemingly the only thing missing from the derby import list shown in this screenshot当尝试导入 JDBC 驱动程序时,它似乎是此屏幕截图中显示的 derby 导入列表中唯一缺少的东西

    • I have also downloaded the derby.jar file and copied it directly into C:\Program Files\Java\jdk8-221\bin我还下载了 derby.jar 文件并直接复制到 C:\Program Files\Java\jdk8-221\bin

I really can't understand why the JDBC driver specifically is missing.我真的不明白为什么 JDBC 驱动程序特别丢失。

I see that you are using release 10.15.我看到您使用的是 10.15 版。 In this release, the arrangement of the Derby distribution into jar files has changed, and this is probably affecting you.在此版本中,Derby 分发到 jar 文件中的排列已更改,这可能会影响您。

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.请仔细阅读10.15 发行说明,特别是请仔细查看“DERBY-6945 说明”部分,了解如何更改类路径以访问 Derby JDBC 驱动程序类的详细信息。

Probably, all you have to do is to include derbyshared.jar .可能,您所要做的就是包含derbyshared.jar But please read the entire thing.但请阅读全文。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM