File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to invoke mysql backup command in java ? (mysqldump)

 
kit james
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need desperately the code that will invoke the mysqldump command aka the mysql backup command..... any1 please reply this thread.
regards
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, kit james!
Using a java.sql.Statement, you can execute database server specific queries. I'm not familiar with MySQL's dump command, but have you tried to simply execute a query using the same dump command that would be used from a MySQL console?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, I just discovered that mysqldump.exe is an executable, not a MySQL command.
Take a look at The Runtime Class Documentation (and the getRuntime and exec methods).
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic