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 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.
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,
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 ..