I have to convert a mysql-database into a java (derby) database. This works fine with ant-tasks, absolutely no problem. Unfortunately not all the tables out of the orginin-database may be used in the target-database. As i found no chance to filter tables by name in the ant-tasks of ddlUtils, i consider to write a small java-application using ddlUtils.jar.
But trying this, i am not even able to extract schema and data out themysql-database. The examples in the ddlUtils-api explain to less for a beginner like me.
Is there a more comprehensive example how to deal with this Problem?
My Plan was to split the work into this steps:
- getting the db-schema from the origin-database (filtered by TableNames)
- getting the data from the origin-database (filtered by TableNames)
- creating the schema in the target-database (Java) by using the reduced db-schema
- inserting the data in the target-database by using the reduced content.
In the api-section "Read the model from a live database" is the method platform.readModelFromDatabase(String) used for this action, but i was not able to instantiate a Platform-object by now which let me call the method without lots of exceptions.
lots of thanks Alf