wood burning stoves*
The moose likes JDBC and the fly likes best method for faster execution Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "best method for faster execution" Watch "best method for faster execution" New topic
Author

best method for faster execution

Rajesh Veluchamy
Ranch Hand

Joined: Jan 15, 2008
Posts: 47
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 ]

-Rajesh.V<br /> Software Consultant
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30076
    
149

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Herman Schelti
Ranch Hand

Joined: Jul 17, 2006
Posts: 387
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: best method for faster execution
 
Similar Threads
Combo box problem in jsp
Need more values from Other DB
How to retrive data two times from database in sinble jsp page.
JSP returning old data, database was changed correctly!
After end of result set exception while i execute the SQL query