Less than 42 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Optimization: JSP and page buffers?  RSS feed

 
Michael Brewer
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've written a custom calendar application for my team here using JSP and JavaBeans. One of my beans uses another bean to connect to SQL Server 7 through the ODBC JDBC bridge. I'm not sure if that is the source of the slowdown, or if it has to do with the fact that I run a SQL query for every day in the month.
Some steps I've taken is removing or commenting out much of my debug code and switching a few String objects to StringBuffers. For instance, I concatenate four strings to make my SQL for readability and for process control. So, I made my SQL a StringBuffer instead of a String. The page doesn't appear to load any faster.
At any rate, in ASP/VB there is a way to buffer the page so that it is either written all at once or drawn incrementally. Depending on the circumstance one of those methods is faster than the other. Is there a way to control this with my JSP or Java?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally speaking, database queries are MUCH slower than anything else a servlet does, so doing an entire month worth one day at a time should be glacial. Also, creating an initial db connection is known to be slow - people typically use connection pools to avoid this.
The ODBC-JDBC bridge is "not suitable for production work" - a better driver would also help.
Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!