codice:
try
{
String command = "cmd /c start mysqldump.exe";
String[] env = new String[] {"--opt", "--u", "root", "--password=\"12345\"",
"assistiti_db", ">", "C:/backup_db.sql"};
File dir = new File("C:/Programmi/MySQL/MySQL Server 4.1/bin/");
Process p1 = Runtime.getRuntime().exec(command, env, dir);
InputStream err = p1.getErrorStream();
InputStream in = p1.getInputStream();
System.out.println("error: " + err.toString());
System.out.println("input: " + in.toString());
System.out.println("\nerror: " + err.read());
System.out.println("input: " + in.read());
}
catch (Exception ex) { ex.printStackTrace(); }
RISULTATO:
codice:
error: java.io.FileInputStream@150bd4d
input: java.io.BufferedInputStream@1bc4459
error: -1
input: -1
cosa vuol dire? dove posso cercare i codici d'errore?