* Returns <code>true</code> if database exist. This method does not use
* thread provided db session, but common db session.
*/
public boolean checkDb() {
log.debug("Check database.");
DbSession dbSession = AppCore.ref.createDbSession();
DbQuery query = new DbQuery(dbSession, "select count(1) from up_user_level");
try {
query.execute();
log.debug("Database OK.");
return true;
} catch (Exception ignored) {
return false;
} finally {
query.close();
dbSession.closeSession();
}
}