Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

best method for faster execution

 
Rajesh Veluchamy
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because of large data, my execution takes long time,
i want to reduce it

what i am doing is adding all the fields in a temporary variable STR
Then calling that in.
like shown below


[changed subject from all caps - this is considered shouting on the internet]
[ February 18, 2008: Message edited by: Jeanne Boyarsky ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34422
347
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rajesh,
Can you post the query? Many performance issues are in the SQL itself.

Some thoughts:
1) You should use StringBuilder or StringBuffer rather than all those string concats. This is unlikely to be your primary bottleneck, but is still good practice?
2) How many columns are in your select statement? If there are any fields you aren't using, you are transferring more data than necessary.
3) Are you required to display 2000 records on the screen in an HTML table? This seems hard to use on the screen. Can you introduce paging and display a reasonable number at a time.
 
Herman Schelti
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Rajesh,

-you can use CSS for makeup (instead of a lot of "align=center" in your String)

-your resultpage can look very funny if one if your rs.getString(x) has html, javascript or css code in it. Better use JSTL for this.

-better put your sql-query in a separate class: better for reuse, easier to test.

Herman
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic