gpt4 book ai didi

java - ij 工具工作 java 代码拒绝连接到 Derby 数据库 10.11.1.1

转载 作者:行者123 更新时间:2023-12-01 11:48:07 27 4
gpt4 key购买 nike

目前我有一个 Derby 数据库...版本 10.11.1.1 通过 Java 应用程序创建,仅当与运行任意查询的 Java 应用程序进行通信时该数据库才起作用。 Maven依赖如下:

   <dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.11.1.1</version>
</dependency>

当我尝试使用 ij 工具或任何其他第三方应用程序时:

i.e. connect 'jdbc:derby:/home/username/dev/db-agents/TESTDB';

无法这样做,提示使用了错误的版本,如下所示:

Caused by: java.sql.SQLException: Database at /home/username/dev/db-agents/TESTDB has an incompatible format with the current version of the software.  The database was created by or upgraded by version 10.11.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
... 12 more
Caused by: ERROR XSLAN: Database at /home/username/dev/db-agents/TESTDB has an incompatible format with the current version of the software. The database was created by or upgraded by version 10.11.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.store.raw.log.LogToFile.readControlFile(Unknown Source)
at org.apache.derby.impl.store.raw.log.LogToFile.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.bootLogFactory(Unknown Source)
at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.setRawStoreFactory(Unknown Source)
at org.apache.derby.impl.store.raw.RawStore.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
at org.apache.derby.impl.store.access.RAMAccessManager.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
at org.apache.derby.impl.db.BasicDatabase.bootStore(Unknown Source)
at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown Source)

我不明白为什么我可以从 Java 应用程序进行连接,而不能从其他应用程序进行连接?我有什么特别做错的地方吗?

最佳答案

您的 ij session 正在使用旧版本的 Derby。

这由运行 ij 时设置的 CLASSPATH 控制。

仔细查看用于启动 ij 的脚本或命令,看看它正在运行哪个版本的 Derby。

然后调整您在 run ij 时使用的 CLASSPATH以便它使用 Derby 10.11,这是您的 Java 应用程序正在使用的版本。

关于java - ij 工具工作 java 代码拒绝连接到 Derby 数据库 10.11.1.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28996088/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com