Skip to content

Instantly share code, notes, and snippets.

@rajkrrsingh
Created November 22, 2016 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajkrrsingh/801c822e6aa6783079405a3077e41b07 to your computer and use it in GitHub Desktop.
Save rajkrrsingh/801c822e6aa6783079405a3077e41b07 to your computer and use it in GitHub Desktop.
java program to run Sqoop Command using google SSHXCUTE framework
import net.neoremind.sshxcute.core.SSHExec;
import net.neoremind.sshxcute.core.ConnBean;
import net.neoremind.sshxcute.task.CustomTask;
import net.neoremind.sshxcute.task.impl.ExecCommand;
public class RunSqoopCommand {
public static void main(String args[]) throws Exception{
ConnBean cb = new ConnBean("localhost", "root","hadoop");
SSHExec ssh = SSHExec.getInstance(cb);
ssh.connect();
CustomTask sqoopCommand = new ExecCommand("sqoop import -Dorg.apache.sqoop.splitter.allow_text_splitter=true
-Dmapred.job.name=test --connect jdbc:oracle:thin:@10.0.2.12:1521:XE
--table TEST_INCREMENTAL -m 1 --username system
--password oracle --target-dir
/tmp/test26
--verbose");
ssh.exec(sqoopCommand);
ssh.disconnect();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment