It is complaining that it cannot find the command "source." Since
"source" is an internal shell command, you obviously will not be able to
find an executable.
You may want to try setting up each environment variable individually
instead of sourcing a file with your environment setup.
For instance, if you are using csh (which it appears to be), try
executing these in your "exec" statement:
"setenv MYVAR1 foo1; setenv MYVAR2 foo2; setenv MYVAR3 foo3;
run_my_executable"
This may work, and will get around the sourcing problem you are
experiencing.
Hope this helps!
Sam Rose wrote:
>
> I've tried this...
> but it doesn't like my source, probably because I need to return this
> value, i.e. hit the enter button after this, is there a bit of code
> that I can achieve this with?
>
> String command ="source /opt/bin/coraenv";
> String runsql = "sqlplus";
>
> Runtime runtime = Runtime.getRuntime();
> Process process = null;
> Process sql = null;
>
> try {
> process = runtime.exec(command);
> sql = runtime.exec(runsql);
> }//end try
>
> this brings up
>
> java.io.IOException: source: not found
>
> -----Original Message-----
> From: Jeff Sturm [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 16, 1999 4:13 PM
> To: [EMAIL PROTECTED]
> Subject: Re: running SQL PLus via a servlet on unix
>
> 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
>
> ___________________________________________________________________________
> 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
--
Julio C. Monroy
Chief Information Officer
MallPhoria!
1400 Fashion Island Boulevard
Suite 940
San Mateo, California 94404
p: 650-349-0300
f: 650-571-1025
[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