I want to load some data into the mysql database during loading of the application. I am using Hibernate for managing database for the application. I can do it in groovy by
Spring already provides a way of initializing databases with content, using a DatabasePopulator.
Here's one quick example that I found, for a Spring Batch sample application. The class to look at in that code is ResourceDatabasePopulator.
Another example is in Spring Social project samples.