I need to copy one table from database A to database B. The challenge is I am using struts and have to write this code in Java. I tried to use copy command creating runtime process. But I get an exception. I used the command below:
Runtime Rt;
Process Prc = null;
String cmd = "";
cmd="COPY FROM id/pass@servicename1 to id/pass@servicename2 CREATE TABLE_C (*) USING (SELECT * FROM PROCESS_LOG )";
Rt = Runtime.getRuntime();
Prc = Rt.exec(cmd);
What am I doing wrong?
I figured it out. I used this command and it is working fine.
In the TEST.SQL I have written the copy command.