0

Hello all I have a requirement which should be accomplished from a java program .The requirement is as follows,

   1.Connect to an SSH enabled unix machine 
   2.Login to sqlplus on the unix machine
   3.execute sqlplus commands
   4.Come out.

I am able to complete the first two tasks but I don't have any idea in completing the tasks in the 3 & 4 points.Any help will be well appreciated

2
  • are you using a java ssh client implementation or simply invoking the ssh command? Commented Dec 20, 2014 at 16:00
  • I am using the code snippet given in the below link journaldev.com/246/… Commented Dec 20, 2014 at 16:04

1 Answer 1

1

In the snippet you post, set the command1 var for example to

String command1= "echo 'SELECT 1 FROM DUAL;' | sqlplus user/password@tnsname"; 
Sign up to request clarification or add additional context in comments.

1 Comment

Perfect.Thanks a lot.please answer one more question.How can I execute multiple sql commands using this

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.