• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is it possible in java to transfer data between two java application

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible in java to transfer data between two java application?Is possible, How can i do this?Is not, Why?
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to CodeRanch!

The short answer is yes, but it might not be as easy as you want. You could open a socket and transfer data that way. If you have a web application, you could make a remote EJB or Spring remoting call. You could transfer via a database or the file system.
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mohammad Aminul Islam wrote:Is it possible in java to transfer data between two java application?Is possible, How can i do this?Is not, Why?




Sure. You can use the network -- TCP or UDP (see the socket related stuff in the java.net package, or NIO). You can use memory mapped files (see NIO). You can use regular files (java.io). You can use any service as a holding place for the data. etc. The standard techniques used by most applications to transfer data -- also are mostly supported with Java.

Henry
 
Mohammad Aminul Islam
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if this two application is currently open, then how can i do this?
 
Jeanne Boyarsky
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By open, I assume you mean a standalone application that is running. Then your choices are the ones Henry and I listed: sockets, reading/writing a file, reading/writing a database, ....
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:By open, I assume you mean a standalone application that is running.



I'm guessing (although we haven't been told anything) that these applications have already been written and don't include any code for transferring data between them. In which case you're probably limited to copy-and-paste via the clipboard. On the other hand my guess might be completely wrong.

However it would be more helpful if we had some idea of what this question is for. General knowledge? A specific problem? Otherwise we're limited to saying things like "Yeah, Java can transfer data".
 
Mohammad Aminul Islam
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I make a gui appliction in which i can convert english to bangla. but is limited by text area, i want to transfer my converted text into anywhere i wish.
 
Jeanne Boyarsky
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Agreed. For that scenario, copy paste sounds best. Or an export to file option so you can transfer the data anywhere you like.
 
Ranch Hand
Posts: 440
4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why not use web services for this?
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's a bit overkill if neither application is an actual web application. You would need to start a web server internal to one of the applications just for this purpose.
 
Satyaprakash Joshii
Ranch Hand
Posts: 440
4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can it be done this way.: One application is exposed as a web service, the second application consumes this web service passes data as the parameters and this data is thus passed to the other app?
 
Rob Spoor
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the first application isn't a web application, you would need to have it run its own web server to be able to receive the web service calls. Like I said, that would be overkill. There are easier ways to setup communication.
If the first application is a web service though, then web services are just fine. I've done the same quite a lot, mostly using SOAP or REST.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic