gpt4 book ai didi

java - 如何从 apache derby 读取错误消息 'database not found'?

转载 作者:太空宇宙 更新时间:2023-11-04 06:11:29 25 4
gpt4 key购买 nike

我通常使用其他语言进行编程,但这几乎是我第一次接触 Java;我被要求理解以下错误日志,该日志来自使用 apache derby 的程序。

我发现问题出在线路上

java.sql.SQLException: Database '/infermeria' not found.

但是读完之后

我仍然无法判断我面临的是纯粹的路径问题还是更深层次的错误。

所以我尝试了最幼稚的技巧,将 infermeria.jar 复制到每个目录中,但仍然不起作用。

因此问题来了:这样的日志足以检测问题吗?

感谢您的回复!!

23/02/2015 11:04:44 [INFO ] Infermeria launched.
23/02/2015 11:04:45 [DEBUG] Trying to connect to: jdbc:derby:/infermeria
23/02/2015 11:04:45 [ERROR] Exception preparing statements
java.sql.SQLException: Database '/infermeria' not found.
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.handleDBNotFound(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at infermeria.Application.prepareStatements(Application.java:136)
at infermeria.Application.<init>(Application.java:88)
at infermeria.Application$1.run(Application.java:1710)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.sql.SQLException: Database '/infermeria' not found.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
... 31 more

最佳答案

它看起来与 this 非常相似问题。

尝试指定数据库的完整路径:“jdbc:derby:/path/to/my/db/infermeria”。

关于java - 如何从 apache derby 读取错误消息 'database not found'?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28671885/

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