![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Executing pl/sql using sqlplus on unix | maverick1234 | Shell Programming and Scripting | 1 | 02-11-2008 10:32 AM |
| Executing pl/sql using sqlplus on unix | maverick1234 | UNIX for Advanced & Expert Users | 1 | 02-10-2008 07:21 AM |
| Executing pl/sql using sqlplus on unix | maverick1234 | High Level Programming | 1 | 02-10-2008 07:19 AM |
| help me in sending parameters from sqlplus script to unix shell script | Hara | Shell Programming and Scripting | 2 | 01-29-2008 12:31 PM |
| Executing UNIX command from java on NT | CJ Walt | UNIX for Dummies Questions & Answers | 1 | 06-25-2003 10:39 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Executing SQLPLUS in UNIX Script from JAVA
Hi ALL,
I would like to execute one SQL query(ORACLE) in UNIX shell script. For this I used sqlplus in script and tested locally. It worked fine. But my requiremnt is to execute the script from Java. In this case the UNIX part is working but sqlplus is not returning anything The JAVA code used is as follows: String user="UNIX_username"; String host="138.108.222.30"; String cmd="ksh script_name.sh"; try { Session session=jsch.getSession(user,host,22); session.setPassword("password"); UserInfo usrInfo=new MyUserInfo(); session.setUserInfo(usrInfo); session.connect(); Channel channel=session.openChannel("exec"); ((ChannelExec) channel).setCommand(cmd); channel.setXForwarding(true); channel.connect(); Could anyone of you give some ideas on the above ? Thanks, ANoo Last edited by anooptech; 04-16-2008 at 06:00 AM. |
|||
| Google The UNIX and Linux Forums |
| Forum Sponsor | ||
|
|