• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need External Back Up in Java Web Application

 
mike mimmis
Ranch Hand
Posts: 57
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 57
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21117
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 57
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic