Results 1 to 5 of 5
  1. #1
    FlyNn is offline Senior Member
    Join Date
    Feb 2010
    Posts
    128
    Rep Power
    0

    Default ResultSet through ObjectOutputStream

    Hi Java Gurus,

    I'll start with a sequence diagram first:

    1. Client app sends a string to server ---> 2. Server calls MySQL procedure ---> 3. MySQL DB builds table---> 4. Server runs a query on MySQL and gets a ResultSet.

    Now, the idea is to return the ResultSet (or data inside the result set) back to the Client app. I know the ResultSet isn't serialized which when I run the program throws java.io.NotSerialisableException.

    I'd like some guidance as to how I could make the result set serialisable or if there are any other ways/techniques to return the data back to the Client app.

    P.S. Is it SerialiZable or SerialiSable. :confused:

    Thanks in advance
    Measuring programming progress by lines of code is like measuring aircraft building progress by weight.

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    See this thread.

    P.S. if you Google there are RMI JDBC Driver examples.

  3. #3
    FlyNn is offline Senior Member
    Join Date
    Feb 2010
    Posts
    128
    Rep Power
    0

    Default

    Thanks masijade :)

    Sounds pretty simple :) Surprised I did not think of that myself :confused: :D
    Measuring programming progress by lines of code is like measuring aircraft building progress by weight.

  4. #4
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,371
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by FlyNn View Post
    I'd like some guidance as to how I could make the result set serialisable or if there are any other ways/techniques to return the data back to the Client app.

    P.S. Is it SerialiZable or SerialiSable. :confused:
    Your server has to fetch the data from each row of the result set and store it in a Vector or a List. After the Vector or List (or whatever) is populated the result set can be closed and the list has to be send to the client. Of course all data in the list has to be Serializable. The British should've written it as serialisable but of course the tribes on the wrong side of the pond spell it as serializable, bloody bastards! ;-)

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    FlyNn is offline Senior Member
    Join Date
    Feb 2010
    Posts
    128
    Rep Power
    0

    Default

    Thanks JosAH

    HashMap it is then! :)

    FlYnN
    Measuring programming progress by lines of code is like measuring aircraft building progress by weight.

Similar Threads

  1. Replies: 3
    Last Post: 02-08-2011, 07:45 PM
  2. Replies: 17
    Last Post: 10-14-2010, 10:26 PM
  3. problem using ObjectOutputStream in multithreading
    By sanjeevbindroo in forum Networking
    Replies: 3
    Last Post: 10-15-2009, 08:00 AM
  4. ObjectOutputStream Example
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-20-2008, 09:21 AM
  5. question on ObjectOutputStream
    By money123 in forum New To Java
    Replies: 5
    Last Post: 07-27-2007, 10:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •