Beware of the pitfalls that can come from using Runtime.exec() Have a look at this article first : http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
Cui Xiaojing-a13339 wrote: >Hello, > >Thanks so much for the help. Now I only want to execute a SQL Server's import/export >utility in Java method. The utility could be executed using below command line in >Windows Command prompt window: > >C:> BCP flex.dbo.CF_load in e:\Flex\file\inbound.txt /f e:\Flex\prog\bcp.fmt /S flex >/U qqqq /P qqqq > >Does the utility could be executed in Java method? If I could use below method to run >it? > > Runtime r=Runtime.getRuntime(); > try{ > > r.exec("BCP flex.dbo.CF_load in e:\Flex\file\inbound.txt /f > e:\Flex\prog\bcp.fmt /S flex /U qqqq /P qqqq"); > > }catch(IOException e){} > >Thanks&Regards, >Xiaojing > > >-----Original Message----- >From: engp0510 [mailto:[EMAIL PROTECTED] >Sent: 2003年8月15日 13:07 >To: Tomcat Users List >Subject: Re: Run Windows' command in Java method > > >http://java.sun.com/docs/books/tutorial/native1.1/ > >----- Original Message ----- >From: "Cui Xiaojing-a13339" <[EMAIL PROTECTED]> >To: "Tomcat Users List" <[EMAIL PROTECTED]> >Sent: Friday, August 15, 2003 11:41 AM >Subject: Run Windows' command in Java method > > > > >>Hello All, >> >>Do you know if windows' command could be executed in Java method? If yes, >> >> >which API class method can be used to do it? Thanks a lot. > > >>Regards, >>Xiaojing >> >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: [EMAIL PROTECTED] >>For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]