I know how to use sqoop through command line.
But dont know how to call sqoop command using java programs .
Can anyone give some code view?
I know how to use sqoop through command line. But dont know how to
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can run sqoop from inside your java code by including the sqoop jar in your classpath and calling the
Sqoop.runTool()method. You would have to create the required parameters to sqoop programmatically as if it were the command line (e.g.--connectetc.).Please pay attention to the following:
Sqoop.runTool()as opposed toSqoop.Main()is the fact thatrunTool()return the error code of the execution.Hope that helps.
RL