The derby database installations of our customer sides have different schema versions. E.g. Customer1 has db schema version 4.1.5.0240, Customer2 has version 4.0.1.0330.
The idea is to update theses schemas to actual version when a new software is installed. There exists several sql scripts in order update a version to next level. E.g. update_4.1.5.0240_to_4.3.1.0020.sql.
The tool/procedure I am looking for should read the actual installed version from a derby database table. According to that version the appropriate sql script shall be run in order to update the schema to next level. This procedure must be repeated until no matching sql script can be found for the actual read version.
The installation at customer site should be done headless without any administrators help.
1.) I would prefer a java program that reads the version using JDBC. But how to run the sql scripts from within java? Should I call the ij commandline tool from java?
2.) Are there better alternatives?
Thanks Viktor