db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oystein Grovlen - Sun Norway <Oystein.Grov...@Sun.COM>
Subject Re: how to copy a derby db?
Date Mon, 17 Dec 2007 09:21:42 GMT

You are right that backup will give you a copy of the database, but your 
answer seem to indicate that you can have only have a single connection 
to an embedded database.  That is not true, when embedding a Derby 
database, you can have multiple connections from the same JVM.  In 
addition, if you start the Derby network server within that JVM, you 
will be able to connect to the database from other processes/computers. 
This way, you should be able to initiate a backup of the database from 
outside the application.

Øystein Grøvlen, Senior Staff Engineer
Architectural Lead, Java DB
Sun Microsystems, Database Technology Group
Trondheim, Norway

Luis Angel Fernandez Fernandez wrote:
> 2007/12/16, Amir Michail <amichail@gmail.com>:
>> Can I copy a db while it is being used or could that lead to a corrupted copy?
>   I can be wrong, but I think you could use something like...
>       CallableStatement cs =  ApplyDBChanges.getConn().prepareCall(str);
>       cs.setString(1, fileName);
>       cs.execute();
>   to make the copy.
>   But I think this has to be done from the same connection, so if you
> meant to make a copy from outside the program using the database what
> I said above will not work (I think).

View raw message