Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2008

    Question Unanswered: Using ResultSet or a specific object

    Hello. I have this doubt... I have and application that queries the DB and displays information (in textfields and the like) and also gives the opportunity to modify the data and update the DB (very common application).

    To do this, should I take the data directly from the ResultSet and into the GUI or should I create an object resembling the DB table, fill that object with the data from the ResultSet and then use the object to fill the GUI.

    Which would be the criteria to choose from one or the other approach?

    Thanks a lot.

  2. #2
    Join Date
    Mar 2008
    Initially I would say look at the amount of data your application is supposed to query each time it calls the data. And then look at how often it does that.

    Then look at how much work it takes to request and deliver the data (incl. network time and server and client I/O etc. in your environment).

    Generally, I would suggest always query only the exact data you need, never the whole bunch at a time if it's really a lot, like thousands of rows or more.

    Unless you have very many concurrent transactions and your database and server can't handle all the database concurrent connections (like hundreds of users at once doing all kinds of things with the table you need). in that case you may want to store the needed data temporarily somewhere else (another object or temporary table or whatnot).

    Also of course it always depends on what DB and System you're using...

    Maybe someone else here can go into more specifics...
    "My brain is just no good at being a relational Database - my relations suck real bad!"

Posting Permissions

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