首页 > 解决方案 > 无法通过 NetBeans 11 IDE 访问 Derby 数据库(“找不到合适的驱动程序”)

问题描述

我已经安装了 NetBeans 11 并安装了 Derby。我已经配置了 Derby 并在 Services 选项卡中启动了 JavaDB 服务器。IDE 报告

  Wed Apr 17 17:26:43 EEST 2019 : Security manager installed using the 
  Basic server security policy.
  Wed Apr 17 17:26:44 EEST 2019 : Apache Derby Network Server - 10.15.1.3 
  - (1853019) started and ready to accept connections on port 1527

创建示例数据库也很顺利。但是……我找不到通过 IDE连接到数据库的方法。它应该像点击几下一样简单(而且一直如此)。(注意:我可以在代码中做到这一点。)这是错误消息

  Unable to connect. Cannot establish a connection to 
  jdbc:derby://localhost:1527/sample using 
  org.apache.derby.jdbc.ClientDriver (Unable to find a suitable driver).

URL 很好,所以这似乎是驱动程序问题。但是,问题出在 Netbeans IDE 中。有什么建议么?

重新安装 NetBeans 并没有解决问题。

标签: jdbcnetbeansderbynetbeans-11

解决方案


将 derbyshared.jar 和 derbytools.jar 添加到“Java DB(嵌入式)”和“Java DB(网络)”的 JDBC 驱动程序定义中,它就可以工作了。您可以在 $DERBY_HOME/lib 目录中找到它们。

有关更多信息,请参阅https://issues.apache.org/jira/browse/NETBEANS-3424?focusedCommentId=17118150&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17118150


推荐阅读