What is the best way to import a full .sql file (with DDL and DML sentences) to a mysql database from a Java application deployed in CloudBees?
Should I try to get the Runtime process and see if something like this works
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec("mysql -p -h ServerName DbName < dump.sql");
(recommended solution in a previous question for a self-hosted environment, not sure if in a CloudBees hosted application I can execute process that access mysql)?
Is there a better solution? (again, to execute it from within the application, the .sql file to import will be provided by the user as part of his interaction with the web application).
I´d really like to avoid parsing the .sql file and sending the sentences one by one through jdbc.