From: olegkon on
Hi,

I need to write a Java program which:
- collects bunch of data from the SQL Server DB (and builds command
line);
- calls windows executable (3rd party, black box, I assume it's
written with .NET 3.5 - maybe VB or C#, but have no source code or
anything)
and passes it long list of parameters.

My Java program will be packaged as executable JAR and reside on some
Windows XP server.
It will be called from job scheduler.
So basically it will be a Java wrapper for that .NET exec.

Could anyone help me with a sample skeleton code to call .NET
executable ?

Sorry, I have no experience with that, I am more of Java/Flex Web
developer.


TIA,
Oleg.


From: Jeff Higgins on
On 4/29/2010 11:28 AM, olegkon wrote:
> Could anyone help me with a sample skeleton code to call .NET
> executable ?
Well, not exactly .NET but may be useful:
<http://www.devdaily.com/java/java-exec-processbuilder-process-1>

From: Arne Vajhøj on
On 29-04-2010 11:28, olegkon wrote:
> I need to write a Java program which:
> - collects bunch of data from the SQL Server DB (and builds command
> line);
> - calls windows executable (3rd party, black box, I assume it's
> written with .NET 3.5 - maybe VB or C#, but have no source code or
> anything)
> and passes it long list of parameters.
>
> My Java program will be packaged as executable JAR and reside on some
> Windows XP server.
> It will be called from job scheduler.
> So basically it will be a Java wrapper for that .NET exec.
>
> Could anyone help me with a sample skeleton code to call .NET
> executable ?
>
> Sorry, I have no experience with that, I am more of Java/Flex Web
> developer.

Runtime.getRuntime().exec(new String[] { "prog", "arg1", "arg2" });

if you need to read output then you need a bit more.

Arne