Solved

Data exchange between Java and non-java apps

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
topping2 challenge 13 82
what is the difference between "sudo su" and "su - root" 6 105
servlet  URL Rewriting 1 27
diffSum example 4 24
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

910 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

19 Experts available now in Live!

Get 1:1 Help Now