aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Running mysql script using ant Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Running mysql script using ant" Watch "Running mysql script using ant" New topic
Author

Running mysql script using ant

Micale Raj
Ranch Hand

Joined: Jul 01, 2009
Posts: 30

Hi

I have following questions ( may be these could be very elementary , but i appreciate if someone could answer them ).

1. How to create mysql database, tables, etc ( included in mysql script ) using ant ?
2. What is the best driver to connect to mysql from my ant script ?
( i found use of "org.gjt.mm.mysql.Driver" in one tutorial. Are there any other drivers which could you for same purpose . i.e to connect to mysql )

Thanks !
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

1) The best way is using the Ant SQL task: http://ant.apache.org/manual/Tasks/sql.html

2) That is the old name of the driver class - don't use it any more. Instead, use com.mysql.jdbc.Driver (I assume you already know you need the driver JAR file in your classpath...)


JBoss In Action
Micale Raj
Ranch Hand

Joined: Jul 01, 2009
Posts: 30

Thank you very much for you reply..Yes I know how to add jar to classpath and I will follow the apache ant manual.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Running mysql script using ant
 
Similar Threads
Rather simple ant question
Struts with MySql
error occurred during intialization of VM could not reserve enough space for object heap & ant
new to hibernate need sample
Ant Script to compile JSP files