You can access a database with Ant. This can be useful when you want to create a database and fill it with some default data at the start/deployment of a project, but also when you want to reset the contents of your database just before invoking your tests!
Example of an Ant target to create a table:
CREATE TABLE br_vote
voteid INTEGER NOT NULL,
reviewid INTEGER NOT NULL,
votevalue INTEGER DEFAULT 5 NOT NULL
The accompanying build.properties for MySQL access in this case reads:
mysql.password = MyDatabaseUserPassword
mysql.user = MyDatabaseUserName
mysql.driver = com.mysql.jdbc.Driver
mysql.url = jdbc:mysql://localhost/myDatabase
mysql.classpath = /classpath/to/mysql-jdbc.jar
Mutatis mutandum for the build.properties, I was also able to successfully access an Oracle DB (LUDO).
Of course, you can also populate a DB this way, by just formulating a different target and putting the appropriate SQL statements in.