Reputation: 458
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;
Upvotes: 0
Views: 1974
Reputation: 21
You can use Runtime class to execute any commands in java. It executes the command as seperate process.
Upvotes: 0
Reputation: 54790
You can execute any shell command using Runtime.exec:
Runtime.exec("mysql db_name < /home/liova/download/tpch/queries/Q1.sql");
Upvotes: 1