views:

637

answers:

3

I am having a problem with Java DB that I just don't know how to resolve. I am creating a DB and connecting to it using Java DB's native JDBC driver. If I relocate that database physically and try to connect to it using its new path, I consistently get XJ004 errors:

ERROR XJ004: Database 'blahblah' not found.

I am sure I am using the correct connection string. Is there any possibility the DB is somehow getting corrupted? Or is there some encoding of the DB path in the DB such that if you relocate a Java DB it gets confused?

I'm really at a loss here. :( Please help!

Jim

+1  A: 

Have you verified that this error message isn't also used when there's no listener on the host machine ... and were you using JavaDB on your local machine before the relocation? Many database systems (and I'm not that familiar with JavaDB) ship set-up to only allow connections from localhost for security reasons. On PostgreSQL for instance, you have to allow TCP connections and bounce the daemon to obtain a remote connection.

Anyway ... since the problem started when you when remote, look for issues related to that first! (And if you can run your application on the remote machine, does that work?)

Steve Moyer
+1 on trying the app on the remote machine... isolate the differences.
ojblass
This is using the embedded driver. By relocating I meant simply physically moving the database files from one location on the disk to another.
There may be a difference if the applicaiton was on the machine with the database to begin with.
ojblass
A: 

I think you must use the createFrom=Path attribute to create the new database.

Have a look at Creating a database from a backup copy in the documentation.

Carlos Heuberger
A: 

There must be a file named derby.log somewhere. Check the error there. If it is not detailed enough, try setting derby.stream.error.logSeverityLevel to a lower value. See the manual for more information.

Marcelo Morales