my dog learned polymorphism*
The moose likes Java in General and the fly likes Java Server Client Desktop Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java Server Client Desktop Application" Watch "Java Server Client Desktop Application" New topic
Author

Java Server Client Desktop Application

Amila Jayatillaka
Greenhorn

Joined: Sep 29, 2006
Posts: 28
Hi everybody,
I'm working on a server client base "Desktop Application". And what I want to do is this,
Client application sending some request code to server application through internet(oh yes, these connections must be secured). and when server application gets this code it will again do some jdbc work and gather some data.
And then server application will return those data again to the client application.
what technology i can use to archive this. should i use RMI or P2P. Or just some secured connection and read data through that.
Im so much confused right now and i need to finish this project by 10th Jan and i have to do my SCWCD exam on 7th help me on this please guys.


SCJP 1.4, SCMAD 1.0, SCWCD 5.0
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19680
    
  19

P2P seems an odd choice given your clearly client-server based protocol.

RMI is an easy solution since all the hard work is done for you. You can secure it quite easily too. Assuming you are using UnicastRemoteObject as your server base, you can pass instances of javax.rmi.ssl.SslRMIClientSocketFactory and javax.rmi.ssl.SslRMIServerSocketFactory to your constructor. All socket communication then uses SSL.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Amila Jayatillaka
Greenhorn

Joined: Sep 29, 2006
Posts: 28
Hi Rob thanks for the quick reply,
If you dont mind can you guide me through a RMI example. I've not done anything before using RMI ... If you can would you give me a gud example.
I only have a abstract idea about rmi but i'll google from what you have just said to get a idea
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19680
    
  19

The Java Tutorials - Trail: RMI is the place to start.

There is one thing I tend to do differently from that trail though. Instead of

I usually also extend UnicastRemoteObject:

This allows me to use my own socket factories.

See also this link.
Amila Jayatillaka
Greenhorn

Joined: Sep 29, 2006
Posts: 28
Wow that was quick ...
and helpful .
I just looked @ it and it seems so good. Thanks Rob thank you very much...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Server Client Desktop Application