Java calling .NET exec

O

olegkon

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.
 
A

Arne Vajhøj

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
 
Joined
May 6, 2010
Messages
2
Reaction score
0
Thank you, guys !

Another related question.
So suppose I am calling that
Runtime.getRuntime().exec(new String[] {"prog1" "param1" "param2"});

Is there any limitation to the size of that parameters line on Windows XP ?
I have to pass a huge parameters list, something over 8Kb.

Is that possible ?

If not, how can we overcome it ?

Any code samples ?

Please advise,
Oleg.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top