0

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();
        }
%>

Edited by nikhilmohan: n/a

4
Contributors
6
Replies
7
Views
7 Years
Discussion Span
Last Post by jwenting
1

1. Smack on hand for using JSP for such task
2. We do not live here 24/7 to answer questions
3. You may want to look on Java and Cron jobs like this

Edited by peter_budo: Correcting link

-1

1. Smack on hand for using JSP for such task
2. We do not live here 24/7 to answer questions
3. You may want to look on Java and Cron jobs like this

i dont want any reply from big peoples lik u... i expected it frm person who willing to help to anybody..

Edited by peter_budo: Correcting link in quote

2

i dont want any reply from big peoples lik u... i expected it frm person who willing to help to anybody..

And what kind of help would you want? Someone to code it for you? What didn't you like from the previous post?

It is true that we are not obligated to provide solutions immediately the moment someone posts a question. Our lives don't resolve around answering your questions. We are not under your payroll. We also have jobs with deadlines to meet

If no one has answered could mean a million things. I personally don't know how to fix what you want.

And the link provided might help you.
If you didn't understand it then ask a question about it.


PS: Peter can you check the link because I could not open it. I don't know if there is something wrong with me or the link.

Votes + Comments
Well spotted, it had double "http://". Ubuntu doesn't automatically preselect content of the pop-up for URL
0

Peter said all there is to say. Even were he wrong (he isn't), after OP's vitriolic response I'd be utterly disinclined to help him.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.