You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by SandipGaikwad <sa...@rediffmail.com> on 2007/11/27 10:06:58 UTC

backup, restore using ClientDriver

Please can anyone tell me how to do backup and restore operation using
derby's ClientDriver. I douldn't find anything on this.
I know how to do backup and restore on EmbeddedDriver.
-- 
View this message in context: http://www.nabble.com/backup%2C-restore-using-ClientDriver-tf4880501.html#a13967083
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: backup, restore using ClientDriver

Posted by SandipGaikwad <sa...@rediffmail.com>.
Thanks Bryan,
here is my program code:-
     public boolean restore(File dir){
        if(dir.exists() && dir.isDirectory()){
            System.out.println(dir.getName());
            try {
                Properties databaseProperties = new Properties();
                databaseProperties.setProperty("user", "ids");
                databaseProperties.setProperty("password", "ids");
                String backupDirectory = dir.getPath();
                String
restoreString="jdbc:derby://localhost:1527/ids;"+"restoreFrom="
                        +backupDirectory+"/ids";
               
dbConnection=DriverManager.getConnection(restoreString,databaseProperties);
                return true;
            } catch (SQLException ex) {
                ex.printStackTrace();
            }
        }
        return false;
    }
The program works properly. I am using Netbeans6 Beta. But when i view data
it doesn't shows empty table as it was previously. Please tell me where i i
did mistake in above restore() function. Also tell me how i can use
hibernate to do restore() operation on javadb.


-- 
View this message in context: http://www.nabble.com/backup%2C-restore-using-ClientDriver-tf4880501.html#a13985752
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: backup, restore using ClientDriver

Posted by Bryan Pendleton <bp...@amberpoint.com>.
> Please can anyone tell me how to do backup and restore operation using
> derby's ClientDriver. I douldn't find anything on this.
> I know how to do backup and restore on EmbeddedDriver.

I don't think it's really any different. You call the backup system
procedure, passing it the arguments to control the backup.

thanks,

bryan