Solved

Data exchange between Java and non-java apps

Posted on 1998-07-27
4
241 Views
Last Modified: 2010-05-18
Hi!

I have an application not-written in Java (can be c, c++ or something else)  I need to create a Java applet (or application if it's impossible with an applet) that will request username/password from the user.  The java app will be called by the non-java application (they're both on the same machine).  Once the user entered his data, they need to be passed back to the calling app, and that's where i'm stuck.  I'd rather not use a socket, nor a temp file or native code.  I thought a pipe stream would be the answer, but then, how to bind the ends of the stream?  
0
Comment
Question by:asavard
  • 2
  • 2
4 Comments
 
LVL 3

Expert Comment

by:mjenkins
ID: 1228410
If I correctly understand your needs (which I'm not sure that I
do), you could use the standard out of the java application as
trapped by your non-java implementation. Quick example:

public class Foo
{
    public static void main( String args[] )
    {
        System.out.println( "LOGIN" );
        System.out.println( "PASSWORD" );
    }
}  

.called by a shell script...

echo Here is some output `java Foo` that you can use

yields the following:

Here is some output LOGIN PASSWORD that you can use

Have I oversimplified your problem?
0
 

Author Comment

by:asavard
ID: 1228411
You did oversimplified it.  I'll try to make myself clearer (being a french Canadian gives me trouble when trying to explain things that I don't really understand myself!!)

First of all, I need to use the awt package.  So a call to the shell won't work I think.  I'd use two edit boxes to get the information, and upon a click to OK, data will be sent back to the calling application (which is a graphic interfaced one too).  So, the problem remains to establish a connection between the two apps to do the data exchange.  What i'm trying to do is create a kind of piped stream, but for apps in two different langages.

For now, the only solution I've found is to make data exchange through the clipboard.  (It works, but I could use better security.

Thanks!
0
 
LVL 3

Accepted Solution

by:
mjenkins earned 90 total points
ID: 1228412
I'm sorry, I think you misunderstood me. It is irrelevent as to
whether or not either application is GUI based. The point is to
pipe the standard output stream of the java app to the non-java
app. Sure pop up your dialog box. But after OK is pushed, write
the data to standard out ( System.out.println() ) and read it in
to the calling application.
0
 

Author Comment

by:asavard
ID: 1228413
Well, it seems that this is something that could be done.  I'll try it.  Thanks for your answer.  (I still like my clipboard solution).

To read from Stdin in C, how could it be done.  (I don't want data to be printed out on screen)

Bye
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now