【发布时间】:2021-01-07 17:51:19
【问题描述】:
我正在将 Apache derby 数据库用于我从事的 Java 项目。
我已经创建了 EVALUATIONCOMS 表,现在我想插入相同的值。
我试试:
public void instertEvalComments(String comment) {
try {
stmt = conn.createStatement();// create a Statement
stmt.execute("INSERT INTO EVALUATIONCOMS"
+ " VALUES ('" + comment + "')" );
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
但我得到了错误:
java.sql.SQLException: The conglomerate (1.744) requested does not exist.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
at gr.aueb.dmst.StopSpread.Database.insterIntoEvalComments(Database.java:242)
at gr.aueb.dmst.StopSpread.ServerClientThread.run(ServerClientThread.java:304)
Caused by: ERROR XSAI2: The conglomerate (1.744) requested does not exist.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.store.access.heap.HeapConglomerateFactory.readConglomerate(Unknown Source)
at org.apache.derby.impl.store.access.CacheableConglomerate.setIdentity(Unknown Source)
at org.apache.derby.impl.services.cache.ConcurrentCache.find(Unknown Source)
at org.apache.derby.impl.store.access.RAMAccessManager.conglomCacheFind(Unknown Source)
at org.apache.derby.impl.store.access.RAMTransaction.findConglomerate(Unknown Source)
at org.apache.derby.impl.store.access.RAMTransaction.findExistingConglomerate(Unknown Source)
at org.apache.derby.impl.store.access.RAMTransaction.getStaticCompiledConglomInfo(Unknown Source)
at org.apache.derby.impl.sql.compile.InsertNode.makeConstantAction(Unknown Source)
at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)
... 4 more
这是我第一次遇到这样的错误,我不知道为什么。
我会向您提供帮助。
注意:我已经执行了相同的方法,只更改了架构中其他表的名称和列,一切正常。我使用的所有其他数据库处理方法也可以正常工作。
【问题讨论】:
-
你试过重启数据库吗?
-
刚做了,我也有同样的错误
-
我怀疑它与表有关,因为当我尝试访问此表时遇到这种错误,而其他表有问题