Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Java calling .NET exec

Reply
Thread Tools

Java calling .NET exec

 
 
olegkon
Guest
Posts: n/a
 
      04-29-2010
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.


 
Reply With Quote
 
 
 
 
Jeff Higgins
Guest
Posts: n/a
 
      04-29-2010
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>

 
Reply With Quote
 
 
 
 
Arne Vajh°j
Guest
Posts: n/a
 
      04-30-2010
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

 
Reply With Quote
 
olegkon olegkon is offline
Junior Member
Join Date: May 2010
Posts: 2
 
      05-06-2010
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Net::SSH.exec Using the "exec" method interactively Guillermo Riojas Ruby 0 11-26-2010 05:17 PM
Runtime.exec(String[]) Doesn't Always Work, bBut Runtime.exec(String) Does Hal Vaughan Java 11 05-22-2006 04:49 PM
exec "statement" VS. exec "statement in globals(), locals() Ted Python 1 07-22-2004 08:51 AM
exec "statement" VS. exec "statement" in globals(), locals() tedsuzman Python 2 07-21-2004 08:41 PM
Backup Exec 9.1: The Backup Exec job engine system service is not responding Christian Falch Computer Support 1 06-23-2004 02:22 AM



Advertisments