Package com.test;
Import Java.io.BufferedInputStream;
Import Java.io.BufferedReader;
Import Java.io.FileInputStream;
Import java.io.IOException;
Import Java.io.InputStream;
Import Java.io.InputStreamReader;
Import Java.util.Date; /** * Java program Import Export database to do program timing (combined with Quartz,log) automatic backup to prevent data loss * * @author leiwei 2011-12-1 * * * Public CLA
SS BackupDB {Runtime Runtime = Runtime.getruntime ();
Process process = NULL;
Boolean issuccess = false; /** * methods for backing up and restoring Oracle databases * * @param cmdstr Backup command (that is, export)/public boolean Backuporreductionor
Acledb (String cmdstr) {try {process = runtime. EXEC (CMDSTR);
Issuccess = true;
catch (IOException e) {e.printstacktrace ();
return issuccess; /** * * * Test/public static void main (string[] args) {//oracle backup, restore command stri ng backupcmd = "Exp SCOTT/TIGER@172.18.27.146/LWORCL file=d:/javadb.dmp full=y ";
String reductioncmd = "Imp scott/tiger@172.18.27.146/lworcl file=d:/javadb.dmp full=y";
Boolean resuccess = new BackupDB (). Backuporreductionoracledb (Backupcmd); System.
Out. println (resuccess); }
}