You should be able to do the same... the Process class works similarly
on Unix.  Either source the environment variables from the script that
starts your servlet engine, or wrap sqlplus in a shell script that first
sources the variables, then invoke the script from Runtime.exec(...).

(Out of curiousity, why would you want to run sqlplus from Java when you
can use JDBC?)

Sam Rose wrote:
>
> Hello,
>
> I'm trying to execute SQL*PLUS with a servlet on unix.
>
> Windows I used this code...
>
> String command ="Plus80w";
>
> Runtime runtime = Runtime.getRuntime();
> Process process = null;
> try {
>         process = runtime.exec(command);
> }//end try
> catch (Exception e) {
>                 out.println("Problem with SQL Plus: " + e);
> }//end catch
>
> but I'm not sure how, as now my servlet's are on unix, to run
> SQL*PLUS.
>
> I now that I have to setup my source which is
>         source /opt/bin/coraenv
>
> but then I'm not sure how to do this in a servlet and then also how to
> start SQL*PLUS.
>
> Any help will greatly be appreciated.
>
> Cheers
>
> Sam
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

--
Jeff Sturm
[EMAIL PROTECTED]

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to