jdbc - 无法通过 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 并没有解决问题。
解决方案
将 derbyshared.jar 和 derbytools.jar 添加到“Java DB(嵌入式)”和“Java DB(网络)”的 JDBC 驱动程序定义中,它就可以工作了。您可以在 $DERBY_HOME/lib 目录中找到它们。
推荐阅读
- r - R - 用 ggplot 在二因子箱线图上写出相对频率
- linux - 错误:依赖失败:pg_statsinfo-10.0-1.pg10.rhel7.x86_64 需要 libpq.so.5()(64bit)
- rust - 将对变量的引用插入到 HashSet 中,然后使用变量
- javascript - 是否有更简单的 lodash 技术来搜索数组参数?
- java - 使用 thymeleaf 将上下文绑定到 html 模板时出错
- orbeon - Orbeon 2018.1 fr-error-summary 渲染问题
- python - Pylint W1202 使用 % 报告但没有
- optix - 如何使用 Optix Context Wrapper 进行 rtPrint
- amazon-redshift - 在 Liquibase 中指定不同的“TAG”列名
- java - Facebook 身份验证失败