title: How to run sql scripts in order to update a Derby schema from java code?
body: <p>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.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>The installation at customer site should be done headless without any administrators help. </p>
  
  <p>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?</p>
  
  <p>2.) Are there better alternatives?</p>
  
  <p>Thanks
  Viktor</p>