我正在 wicket 中做一个项目如何解决这个问题。我遇到了这样一条消息:WicketMessage: Can't instantiate page using constructor public itucs.blg361.g03.HomePage()
根本原因:
java.lang.UnsupportedOperationException: [SQLITE_BUSY] 数据库文件在 itucs.blg361.g03.CategoryEvents.CategoryEventCollection.getCategoryEvents(CategoryEventCollection.java:41) 被锁定(数据库被锁定)
public List<CategoryEvent> getCategoryEvents() {
List<CategoryEvent> categoryEvents = new
LinkedList<CategoryEvent>();
try {
String query = "SELECT id, name, group_id"
+ " FROM event_category";
Statement statement = this.db.createStatement();
ResultSet result = statement.executeQuery(query);
while (result.next()) {
int id = result.getInt("id");
String name = result.getString("name");
int group_id = result.getInt("group_id");
categoryEvents.add(new CategoryEvent(id, name, group_id));
}
} catch (SQLException ex) {
throw new UnsupportedOperationException(ex.getMessage());
}
return categoryEvents;
}
在 itucs.blg361.g03.HomePage.(HomePage.java:71)
categories = categoryCollection.getCategoryEvents();
在 java.lang.reflect.Constructor.newInstance(Constructor.java:525)