如何阅读错误消息'未找到数据库'来自阿帕奇德比?

时间:2015-02-23 10:43:31

标签: java derby

我通常用其他语言编程,但这几乎是我第一次接触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

1 个答案:

答案 0 :(得分:1)

它与this问题非常相似。

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