Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ant target to create a database in mysql

 
Pranav Butala
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic