File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes How to invoke mysql backup command in java ? (mysqldump) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to invoke mysql backup command in java ? (mysqldump)" Watch "How to invoke mysql backup command in java ? (mysqldump)" New topic
Author

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

kit james
Greenhorn

Joined: Apr 08, 2003
Posts: 14
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

Joined: Dec 10, 2001
Posts: 7023
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?


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
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
 
subject: How to invoke mysql backup command in java ? (mysqldump)