Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

transfer a set of records(.mdb file) from client to server  RSS feed

 
sigamala viswanath
Greenhorn
Posts: 26
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need some help from you people on JAVA. First of all let me brief you about the requirement and what I am trying:

Requirement:
1) I want to transfer a set of records(.mdb file) from client to server.

What I am trying:
1) I pulled the required records into a recordset.
2) I created a hash table and converted the recordset into a hash table. Reason behind this is recordset is a non-serializable object.
3) I opened a socket between client and server.
4) I transfered the above hash table on the socket.
5) I read the socket and type casted the data into hash table.
So far so good, no problem at all.

Question:
1) Once the socket is opened then I can send anything, i.e. I can send a command or I can send the hash table(record set), anything..
I want to know on the other end that ok now the data that is coming on this socket is a command or the data is a record set..because if it a recordset then i need to de-serialize it. How can I achieve this? Did I communicate? Please let me know.

Thanks,
Viswanath
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to create a protocol so you can tell the difference between data and commands. The Java Tutorial Custom Networking Chapter has a simple example.
 
Dave Robbins
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
an easy way to implement what Joe is talking about is to use a servlet on the server end and a HttpURLConnection on the client end
so now your protocol is http
a lot of work is already done for you that way

Dave
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!