I have a large number of source commands to execute. So I want to write some Java code to do this. Is there a way to do this in Java?
source command is like this:
mysql> source /home/liova/download/tpch/queries/Q1.sql;
You can execute any shell command using Runtime.exec:
Runtime.exec("mysql db_name < /home/liova/download/tpch/queries/Q1.sql");
System.currentTimeMillis() before and after.waitFor(). Just be aware of the pitfalls: javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html?page=4
Runtime.exec()will work for you