Ty, If you put it in a shell script, it's one step .
There's nothing special about Class.forName or DriverManager. You use the same code with a different driver class name. Then you get two connection, one each. Basically, you have all the JDBC code twice. Note that this solution is much more complicated than the command line export/import. It's also likely to be significantly less efficient.