Solved

Data exchange between Java and non-java apps

Posted on 1998-07-27
4
261 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
recursion example 16 124
rhino JavaScript import, load 25 82
replace a word with other 1 44
hibernate example issues from command prompt 10 40
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…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
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 will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

813 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

18 Experts available now in Live!

Get 1:1 Help Now