db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Pendleton <bpendle...@amberpoint.com>
Subject Re: Unable to connect. Cannot establish connection to <derby databas url>
Date Fri, 05 Feb 2010 15:08:13 GMT
> But all of a sudden the table disappeared from the list, i decided then
> to close everything and try to connect again, where i get the following
> message:
> "Unable to connect. Cannot establish a connection to <derbydb url> using

One possibility is that when you closed your previous application, you
didn't fully terminate it, and the underlying JVM was still running and
Derby still had the database booted. Derby won't let you open the database
a second time from a second JVM until the first JVM fully terminates.

> I then renamed the database folder, of the database, set a new
> jdbc:derby connection up to the database and all of a sudden my schema
> is available, and everything is back to normal again.
> What happened?

If your connection URL says "create=true", Derby will automatically create
a fresh new database if the database doesn't exist when you ask to open it.

Derby will also auto-create a schema with a name which matches your user
name, so I'm guessing that your schema is the same name as your Derby user name.

You didn't say much about your application, but I'm guessing that it
automatically creates your database tables if they don't exist? Many
applications are coded in such an automatic fashion.

It's easy to get confused when you're first starting to learn a complex
piece of system software. Take your time, learn to read the Derby logs
and operating system process viewing tools, and things will start to
make more sense, I believe.



View raw message