my dog learned polymorphism*
The moose likes Distributed Java and the fly likes how to connect  two servers using java. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "how to connect  two servers using java." Watch "how to connect  two servers using java." New topic
Author

how to connect two servers using java.

vikas malviya
Greenhorn

Joined: Aug 06, 2009
Posts: 14
Hi...all

i have to create an application in which two servers are two be connected.consider an example of login page in which all the details of login page are store in server1 and i have to store the data in another server i.e server2.....the main thing is thet both servers are in different locations.
eg.

server1 is in india and server2 is in US.

1.code for the connection of server1 to server2.

2. how to send data from server1 to server2.

Regards,

Vikas Malviya
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12760
    
    5
You have a lot of options with Java.

One of the simplest would be to HttpURLConnection - assuming both can handle HTTP connections.
Another alternative would be email.

Packaging the data for transmission could be as simple as emulating an Http form request with named parameters or as complex as an encrypted SOAP message.

What are your requirements for secrecy, security and authentication of the data? How large is the data likely to be.

Bill
Sachin Kumar
Greenhorn

Joined: Aug 31, 2008
Posts: 20
your scenario is simple. It happens when keep static contrents on web servers and secured or business components on app servers where data is processed by app server. In your case you can achieve it through virtual directry mapping or including rthe login page data from server 1. Client application or user should always talk to server2 and you post data should go to server2.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to connect two servers using java.
 
Similar Threads
LDAP: error code 49 - 80090308: LdapErr: DSID-0C090334
server crashes
Communication Between two servers
HttpServletRequest , HttpServletSession are they serializable
extract information from LTPA