Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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