Roozbeh wrote:
Hi,

I'm facing a really annoying problem and that is "Failed to start database".
I'm using maven to create the database and the run some test cases on the
database one after each other. I first create a connection and create the
database and then I shutdown the connection in the next step I again try to
connect to the embedded database but basically I face this problem:

java.sql.SQLException: Failed to start database 'c:/database', see the next
exception for details.

[trace snipped]

Does anyone have any Idea?

Look at the next exception. :-)

SQLException supports a chaining model and Derby uses it when multiple exceptions are involved or more context is needed that just the original exception. Typically the actual problem is the last exception in the chain, displaying the entire chain will make debugging issues much easier. Here's an example of how to walk the chain.

catch (SQLException e) {
  do {
    System.out.println(e.toString());
    e.printStackStrace(System.out);
    e = e.getNextException();
  } while (e != null);
}

Dan.


Reply via email to