can anyone help me to backup/restore my database file by using jsp code??? im using postgres sql...
please its urgnt..tnx in adv. i am using fedora 11
i got this code from an article. but i know it will not wrk.. pls help me if any one hav any idea.
<%
File test=new File("/media/data/test00.sql");
FileWriter fw=null;
try {
Runtime runtime = Runtime.getRuntime();
File backupFile = new File("backup/backupScript.sql");
fw = new FileWriter(backupFile);
Process child = runtime.exec("pg_dump -h org.postgresql.Driver -U postgres -W EmplDir_MySQL> db.20070725.dump Password:postgres");
InputStreamReader irs = new InputStreamReader(child.getInputStream());
BufferedReader br = new BufferedReader(irs);
String line;
while( (line=br.readLine()) != null ) {
fw.write(line + "\n");
}
fw.close();
irs.close();
br.close();
} catch (IOException ex) {
ex.printStackTrace();
}
%>