• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Tim Cooke
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Piet Souris
Bartenders:

ResultSet JavaBean

 
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I'm looking for ways to improve the speed of my SQL search and was thinking JavaBeans might do it.

I have had a little look rounf tinternet to see how to do it, only thing is I'm not sure if I can put all of the results into one BEan or if I need to create a new Bean for each line of the results?

Is there a way of creating an array of get/set for one Bean or wil i need to create a new instance of the Bean each time.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JavaBeans won't improve the speed of your SQL.
You'll use them to store the db records (usually one bean per record), and arrange them a convenient way for you to retrieve them. For example, using a primary key as the key of a Map.
 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the database that you're using allows for indexes creation, then you should probably being using indexes to speed things up. Index the columns that are used in the WHERE clause.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic