This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 5811
    
    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
Ant Script to compile JSP files
new to hibernate need sample
Rather simple ant question
Struts with MySql
error occurred during intialization of VM could not reserve enough space for object heap & ant