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?