If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > JAVA > Using ResultSet or a specific object

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-04-08, 19:55
saul_2110 saul_2110 is offline
Registered User
 
Join Date: Dec 2008
Posts: 1
Question 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.
Reply With Quote
  #2 (permalink)  
Old 12-23-08, 08:06
freeBatjko freeBatjko is offline
Registered User
 
Join Date: Mar 2008
Posts: 89
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!"
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On