I have an interesting question regarding Java and networks.
I am creating a basic chatting program, which is only for learning purposes. Now, I have properly connected a client to a server before and sent text back and forth. That's perfectly fine. However I am running into a problem.
Say I have a database on a remote server somewhere. That database is going to contain login information, contact list information, etc for the instant messaging program. This means that I am going to need to perform queries on the database when the client does something. Obviously I know that the client should not contain the connection string or have any access what-so-ever to the database.
My question is: what is the best way to have a client-server architecture for chatting purposes with multiple potential clients, but also have a method of sending data over the network so that queries can be made on the server side?
It may be a simple answer, but for some reason I am having trouble wrapping my head around multiple sockets/serversockets sending data at the same time.
Thanks.