posted 19 years ago
Kindly I would like to ask what is the preferred way of loading a file containing multiple sql-statements (CREATEs and INSERTs) into a (MySQL) database?
In the setUp()-method of a JUnit-test, I would like to freshen up the test-database by dropping all tables and loading a new default state. Since some of the INSERT-statements contain quotes (") or other special characters, I cannot just load everything into a single Statement.
Is there a convenient way to encode the data so it can be used in a simple statement.executeQuery(sql)?
Thanks for your time,
Mark