This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
On the client side I send two messages one for the database action to be performed and the send is the information needed to get the job done.
Example I want to search for a product in the database.
I send to the server an output message saying search product.
I then send to the server which product I want to be searched.
The server then retrieves the message by in.readUTF();
switch statement determines what database action should be performed.
Within that case I call another in.readUTF() to pass the information to the database on what product to search for.
Would this work or would the server read both messages from the client as one input stream?