Subject | Re: Restore FBBackupManager not working (non localhost only) - localhost works |
---|---|
Author | Ashok122 |
Post date | 2006-10-23T17:30:18Z |
>replicates the
> Could you still post a small but complete code sample that
> problem? I'm planning on getting access to a Windows machine to try toHere it is.....
> verify what's going on here.
>
> - Gabriel
>
import java.io.*;
import java.sql.SQLException;
import org.firebirdsql.gds.*;
import org.firebirdsql.gds.ISCConstants;
import org.firebirdsql.gds.ServiceRequestBuffer;
import org.firebirdsql.gds.impl.GDSType;
import org.firebirdsql.gds.impl.GDSFactory;
import org.firebirdsql.management.FBBackupManager;
import org.firebirdsql.management.FBManager; // Needed to create new
BACKUP.
public class Main {
public static void main(String args[]{
RestoreBackup("c:\backups\new1.fdb",
"c:\backups\test1.fbk",
"remotecomputer"); // #1
// #1: Test and see what output comes here.
RestoreBackup("c:\backups\new1.fdb",
"remotecomputer:c:\backups\test1.fbk",
"remotecomputer"); // #2
// #2: Test and see what output comes here.
RestoreBackup("c:\backups\new1.fdb",
"localhost:c:\backups\test1.fbk",
"remotecomputer"); // #3
// #3: Test and see what output comes here.
}
public static void RestoreBackup(String sFDBName,
String sFBKName, String sSrvrName) {
sSrcDBPath_and_fileName = sFDBName;
sTgtDBPath_and_fileName = sFBKName;
FBBackupManager fb = new FBBackupManager(GDSType.getType("PURE_JAVA"));
fb.setUser("sysdba");
fb.setPort(3050);
fb.setHost(sSrvrName);
fb.setPassword("masterkey");
fb.setLogger(System.out);
fb.setVerbose(true);
fb.setDatabase(sSrvrName + ":" + sSrcDBPath_and_fileName);
fb.setBackupPath(sTgtDBPath_and_fileName);
fb.setRestoreReplace(true);
try {
fb.restoreDatabase();
} catch (SQLException ex) {
ex.printStackTrace();
}
}
}
Thanks,
Ashok