// Maybe strange but 'SHUTDOWN' state seems to be an intermediate
// state during startup
retryNb++;
if (this.server.getState() == ServerConstants.SERVER_STATE_SHUTDOWN && retryNb >= MAX_RETRY_NB) {
Throwable t = this.server.getServerError();
throw new EZBComponentException("Cannot start the server. The server has not started and is shutdown.", t);
}
logger.debug("retry= {0}, serverState= {1}", retryNb, this.server.getState());
}
String connURL = "jdbc:hsqldb:hsql://" + this.hostname + ":" + this.portNumber + "/" + this.databaseName;
logger.info("{0} started with URL {1}", this.server.getProductName(), connURL);
Connection conn = null;
Statement st = null;
try {
conn = DriverManager.getConnection(connURL, "sa", "");
} catch (SQLException e) {
throw new EZBComponentException("Cannot access to HSQL", e);
}
try {
st = conn.createStatement();
} catch (SQLException e) {
try {
conn.close();
} catch (SQLException connEx) {
logger.error("Error while closing connection object", connEx);
}
throw new EZBComponentException("Cannot access to HSQL", e);
}
// Drop users before recreating it