Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
Runtime.getRuntime().exec("cmd /C/Programme/MySQL/MySQL Server 6.0/bin/mysqldump.exe studio -h localhost -a -C -c -e --user=root --password=passwort > backup/backup%Date%.sql");
String[]command={"cmd","/c","/Programme","/MySQL","/'MySQL Server 6.0'","/bin","/mysqldump.exe studio -h localhost -a -C -c -e --user=root --password=passwort > backup/backup%Date%.sql"};
ProcessBuilder builder = new ProcessBuilder( command);
process=builder.start();
process.waitFor();
try
{
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec("cmd /C/Programme/MySQL/");
InputStream stderr = proc.getErrorStreamsql'");
InputStreamReader isr = new InputStreamReader(stderr);
BufferedReader br = new BufferedReader(isr);
String line = null;
System.out.println("<ERROR>");
while ( (line = br.readLine()) != null)
System.out.println(line);
System.out.println("</ERROR>");
int exitVal = proc.waitFor();
System.out.println("Process exitValue: " + exitVal);
} catch (Throwable t)
{
t.printStackTrace();
}
Process proc = rt.exec("cmd /c \" c:\\Programme\\MySQL\\MySQL Server 6.0\\bin\\mysqldump.exe studio -h localhost -a -C -c -e --user=root --password=**** > backup%Date%.sql \" ");
public static void main(String[] args) throws IOException {
// Backup Prozess definieren
ProcessBuilder builder = new ProcessBuilder("cmd",
"/c",
"mysqldump.exe",
"test",
"-hlocalhost",
"-a",
"-C",
"-c",
"-e",
"--user=root",
"--password=*******",
">",
"D:/backup%date%.sql");
// Ausführungsverzeichnis setzen, dann muss man nicht sich mit
// den Leerzeichen
// rumärgern
builder.directory(new File("C:/Programme/MySQL/MySQL Server 5.0/bin"));
// Mögliche Fehler in extra Datei schreiben
Process process = builder.start( );
Scanner s = new Scanner(process.getErrorStream( )).useDelimiter("\\Z");
if (s.hasNext( )) {
FileWriter writer = new FileWriter(new File("d:/backup_error.sql"));
writer.write(s.next( ));
writer.flush( );
writer.close( );
}
}