A variety of database types are often used in the development process. For example, projects may need to support Oracle, MySQL, MSSQLServer, Derby, and so on. There are already many small
A variety of database types are often used in the development process. For example, projects may need to support Oracle, MySQL, MSSQL Server, Derby, and so on. There are already many small
A variety of database types are often used in the development process. For example, projects may need to support Oracle, MySQL, MSSQL Server, Derby, and so on. There are already a variety of gadgets that can help developers perform schema, data conversion, and synchronization between databases. DdlUtils is one of them. It can combine Ant or program code to convert database schema/data and xml files.
For example, project development supports MySQL, and for the sake of cleanliness and convenience of unit testing, developers decide to use Derby to support unit testing. DdlUtils can export the schema and data from MySQL to an xml file, and then import the data to Derby as needed. Obviously, these exported xml files are also a good backup for the database.
The following is an xml example provided on the apache ddlutils official website. The table and column labels support more than the child and attribute in the example.
DdlUtils contains three Ant tasks: databaseToDdl, ddlToDatabase, and dumpMetadata.
Example of using ddlToDatabase:
This Ant task creates a PostgreSQL database and imports the schema and data defined in xml into the database.
Example of using databaseToDdl:
This Ant task exports schema and data from the derby database to an xml file.