Create database with JPA?

Viewed 11322

When I create (using JPA - java persistence api) a persistence unit and then persistence entities they auto create the corresponding tables and fields in the database.

Can I also make it to auto create the database (if it doesn't exist)?

My objectif is :

I mean it creates inside the database the tables and fields, but not the database, and if the database hasn't been created before (by hand) - everything fails. So before running the project (which will auto generate the tables and fields if needed) I first must create (by hand) a database.

I use : Eclipse (Java, Hibernate, Flex/Air), MySQL

Thanks for all information

2 Answers
Related