Results 1 to 5 of 5
  1. #1
    WeaponX is offline Member
    Join Date
    Jul 2011
    Location
    San Salvador, El Salvador
    Posts
    3
    Rep Power
    0

    Default Oracle backup with Java

    I doing a small program to make a exp backup w/Java, i using runtime.exe() and i executed the program in the shell of Windows XP, but i dont get any results , but if i change the string that contains the exp command for an ping 127.0.0.1 for example it works!, do i need something special to execute in Java these Oracle instructions?, help me, this is my 1st post ever

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,556
    Rep Power
    23

    Default

    i dont get any results
    Where are you looking for the results?
    Are you looking at both the streams you get from Process returned by Runtime exec()?

    runtime.exe()
    Is this correct or do you mean: runtime.exec()?

  3. #3
    WeaponX is offline Member
    Join Date
    Jul 2011
    Location
    San Salvador, El Salvador
    Posts
    3
    Rep Power
    0

    Default Here is my code

    I expect to see results in my shell, telling me that the exportation was done correctly but i just get a blinking _

    import java.util.*;
    import java.io.*;

    public class Exp1
    {

    public static void main(String[] args)
    {

    Process proc;

    String cmd = "exp HA050259/HA050259 file=backup2.dmp log=backup2.log tables=alumnos query=\"\"\"where nombre like\'O%\'\"\"\"";

    try {

    proc = Runtime.getRuntime().exec( cmd );

    InputStream is = proc.getInputStream();
    BufferedReader br = new BufferedReader( new InputStreamReader(is) );

    String aux = br.readLine();
    while( aux != null ) {
    System.out.println( aux );
    aux = br.readLine();
    }


    } catch( Exception exc ) {

    System.out.println( "Ha ocurrido un error al ejecutar el comando Error" + exc );

    }

    } // main
    }

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,556
    Rep Power
    23

    Default

    What about the error stream?

    Does the command run without any user input?

  5. #5
    WeaponX is offline Member
    Join Date
    Jul 2011
    Location
    San Salvador, El Salvador
    Posts
    3
    Rep Power
    0

    Default

    do the same
    yes it is just an export, show several lines of the export, at the end telling that was done. You just need to have Oracle express instaled, if i change the content of the string for an ping 127.0.0.1 native command of shell, it works.

Similar Threads

  1. Backup Tool Entirely Written in JAVA
    By rajyarr in forum Advanced Java
    Replies: 5
    Last Post: 04-06-2011, 04:37 AM
  2. USB Backup
    By Mir in forum New To Java
    Replies: 5
    Last Post: 08-06-2008, 11:29 AM
  3. MySQL 5.0 data backup from java
    By sanjay_sharma77 in forum JDBC
    Replies: 1
    Last Post: 11-06-2007, 12:19 PM
  4. Areca Backup 5.0.1
    By levent in forum Java Software
    Replies: 0
    Last Post: 06-05-2007, 11:52 AM
  5. Areca Backup 5.0
    By levent in forum Java Software
    Replies: 0
    Last Post: 05-29-2007, 03:07 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •