I hava an issues with a program i am writing. It is a client/server with a database (3 Tier) The majority of requests are related to SQL Select statements. The purpose is to for instance type in a name on a GUI on the client side and return results relating to that name.
The client and the server are setup and i can communicate when testing using the putln(x)...flush() commands...my headache comes when trying to work out how to get alot of information back to the client...
Would anyone be able to point me in the right direction...
Write a loop that converts each row that the ResultSet returns into some kind of custom object. Add this object to an ArrayList, so you will end up with a list of some kind of object. Close the ResultSet and send the List back to the client.
Do I understand correctly this works so far, sending one String each way?
The reason this works is that your streams handle Strings quite naturally but not other objects. To send other objects back & forth you'll need to look up ObjectInputStream, ObjectOutputStream and (if you make your own objects) Serializable.
See if that's enough of a hint. I've had good luck with just about any standard Java class doing Google for "java whatever tutorial". Give it a try and show us what you make!
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi