aspose file tools*
The moose likes JDBC and the fly likes Need External Back Up in Java  Web Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Need External Back Up in Java  Web Application" Watch "Need External Back Up in Java  Web Application" New topic
Author

Need External Back Up in Java Web Application

mike mimmis
Ranch Hand

Joined: Feb 11, 2011
Posts: 57

Hi rancher's,

I am developing an web application which uses Jsp,Servlets. database is MySql.

I want my database backup externally like when we click a button backup file("like (" example.sql") on desktop of client system.


I done using "sqldump" query to create .sql file externally but to use sql dump we need Mysql Root directory.
It is externally possible by command prompt like:

CMD:>cd MySQL ;

CMD:\ MySQL > cd bin;

CMD:\ MySQL\bin> mysqldump -username -password database name > save-filename.sql


It is working externally fine. But the problem is how to get MySQL root directory from my Java application .


or any other ways to do back up my web application data.

Thanks in Advance....

Fatih Keles
Ranch Hand

Joined: Sep 01, 2005
Posts: 182
Hi Mike,

Database backup is a routine process, If I were you I would handle mysql backup with crontab/scheduled job at OS level. Anyways, it is your choice, you can add mysql/bin to PATH, you need not to know exact path to installation directory of mysql.

Regards,
Fatih.
mike mimmis
Ranch Hand

Joined: Feb 11, 2011
Posts: 57

Fatih Keles wrote:Hi Mike,

Database backup is a routine process, If I were you I would handle mysql backup with crontab/scheduled job at OS level. Anyways, it is your choice, you can add mysql/bin to PATH, you need not to know exact path to installation directory of mysql.

Regards,
Fatih.



Thanks for reply

How can i add MySql/bin to my servlet path can you give with a small snipet if possible.

Thanks and Regards,
mike
Fatih Keles
Ranch Hand

Joined: Sep 01, 2005
Posts: 182
I am guessing that you are using Runtime.exec to execute a command line script. Just add mysql/bin path to environment variable PATH. In linux it would be something like this.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

A script would be a good idea, regardless of operating system. But in the absence of a script, setting the current working directory of a process run via Runtime.exec() is possible if you use one of the overloaded versions of the exec() method which allow you to specify the current working directory.
mike mimmis
Ranch Hand

Joined: Feb 11, 2011
Posts: 57

Paul Clapham wrote:A script would be a good idea, regardless of operating system. But in the absence of a script, setting the current working directory of a process run via Runtime.exec() is possible if you use one of the overloaded versions of the exec() method which allow you to specify the current working directory.




sir can you explain me more precisely I am unable to understand ..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need External Back Up in Java Web Application