Friday, October 28, 2005

JDBC Performance Pointers

Here are a few of the JDBC Performance pointers. Hopefully, there are a lot more, which you may be aware of, but not mentioned here. Care to share them as well?

  • Get database connection from connection pool rather than getting it directly
    Use batch transactions.
  • Choose right isolation level as per your requirement.
  • TRANSACTION_READ_UNCOMMITED gives best performance for concurrent transaction based applications. TRANSACTION_NONE gives best performance for non-concurrent transaction based applications.
  • Your database server may not support all isolation levels, be aware of your database server features.
  • Use PreparedStatement when you execute the same statement more than once.
  • Use CallableStatement when you want result from multiple and complex statements for a single request.
  • Use batch update facility available in Statements.
  • Use batch retrieval facility available in Statements or ResultSet.
  • Set up proper direction for processing rows.
  • Use proper getXXX() methods.
  • Close ResultSet, Statement and Connection whenever you finish your work with them.
  • Write precise SQL queries.
  • Cache read-only and read-mostly tables data.
  • Fetch small amount of data iteratively rather than whole data at once when retrieving large amount of data like searching database etc.
  • Use Type one driver if you don't have a driver for your database. This is a rare situation because all major databases support drivers or you will get a driver from third party vendors.
  • Use Type two driver for two tiered applications to communicate from java client to database that gives better performance than Type1 driver.
  • Use Type three driver to communicate between client and proxy server ( weblogic, websphere etc) for three tiered applications that gives better performance when compared to Type 1 &2 drivers.
  • Use Type four driver for applet to database communication that is two tiered applications and three tiered applications when compared to other drivers.
  • Pass database specific properties like defaultPrefetch if your database supports any of them.

Tuesday, October 25, 2005

[Humor] Always give your 100% to work

Always give your 100% to work... :)

[received in an email]

Friday, October 21, 2005

Flock is here (Developer Review Release)

Have just installed Flock, the new Firefox based browser. Too early for any review, it is still deep in the 'developer review'. Download and check it out yourself. Actually, I got the invitation to check it from Flock guys. They even sent me a userid/password, but I didnt require it to download it :))

Thursday, October 20, 2005

Friday, October 14, 2005

Google Home page in 2084

Srinivas has published an image of the 'purposed' Google Home Page in 2084. Check it out :: A Java Geek's Diary : Weblog

Monday, October 10, 2005

Spam Comments

In the past few days, some of my posts have been receiving 'spam comments'. Therefore, I have enabled the word-verification option to discourage the spammers. Hope, it wont discourage the people who really want to share the experiences.


Popular Posts (Last 30 days)

This is a personal blog and I do not speak for my employer.