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 Ant target to create a database in mysql 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 "Ant target to create a database in mysql" Watch "Ant target to create a database in mysql" New topic
Author

Ant target to create a database in mysql

Pranav Butala
Greenhorn

Joined: Jan 20, 2004
Posts: 27
Is there a way to design an ant target that will create a database in MySQL ?
The target depends on configure target that gets all JDBC info
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

I think so. Have a look at the <sql /> task - which is just a way for Ant to run SQL against an RDBMS through JDBC. I say I think so because I've never tried to create a DB this way. I can't remember if MySQL JDBC connections strings require a database name - which would obviously be an issue if the DB doesn't exist yet. Check the Ant docs for what you need to make this work.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
 
subject: Ant target to create a database in mysql
 
Similar Threads
Rather simple ant question
My SQl prob
Ant task
replaceToken with multiple lines
Configuration management of JBoss files