Luis,

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 <[EMAIL PROTECTED]>:
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...

      String str = "CALL SYSCS_UTIL.SYSCS_BACKUP_DATABASE(?)";
      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).


Reply via email to