Network Programming

Dear all,

I am in a little problem can anyone help me in this ?

I have 3 database servers

DB1

DB2

DB3

One single web application server

And

DB1 has details of City - New York

DB2 has details of City - London

DB3 has details of City - Chennai

My client will login as

Username john

Password xxxx

City London

So i need to locate the DB2 through the WebServer

Currently this is done in PB Client Server application through network programming sending UDP Packets (asking are you the database for the City London ? ) to each Database and in each database server there is a small c++ application running and listening to the UDP Packets.

If the receiveing database is the proper Database assigned for that City then c++ program will respond to that client and client will get connected to that database.

So, How i can do this in Web Application ?

Please help me in this regards Waiting for you guys reply.

Thank you

Regards

[1054 byte] By [Waheeda] at [2007-10-3 0:22:01]
# 1
Do you need dynamic discovery of the Database servers?Do they move very often?If not you could hardcode the addresses?If your DB move often then you could send a DataGram http://www.google.co.uk/search?q=java+UDP+tutorial
Peter__Lawreya at 2007-7-14 17:13:55 > top of Java-index,Archived Forums,Socket Programming...
# 2

>

> So, How i can do this in Web Application ?

>

What exactly is the question?

A web application means you have a web server and it does the database calls. So it can do exactly the same thing you are doing now.

That need not change just because it is a web app.

On the other hand there are other possible solutions that could potentially even apply to the gui. For example caching the different cities and then only retrying the look up if the connection fails. Potentially you would need to persist the cache.

As suggested you could also just configure the information in a config file particularily with public host names.

Or you could set up a name server. Every app then asks it for the destination.

jschella at 2007-7-14 17:13:55 > top of Java-index,Archived Forums,Socket Programming...
# 3
What if he maintan three connection pools each of a DB.Acording to the OP the user specifies the city that he is interested in at the time of login so based on that you can select which pool to use.
LRMKa at 2007-7-14 17:13:55 > top of Java-index,Archived Forums,Socket Programming...