Our office is new in implementing J2E technology. We are set up with JRun and ms sql server. The db admin was horrifed when he opened the sql server log and saw all the connections by one of my applications. Basically, the site queries the db almost at every page, to collect, display the different info. So everytime the user browses a page, data is being pulled from sql. Am I doing anything wrong? I thought that everytime I connect, I should close the connection.
hi Zeina Afif , What i will suggest here is to store everything in application level,so that u donot have to go to Database again and again. This is much better solution.Instead of getting information on each page from database.Store in APP level. See if this fits in your problem.
Setting up or tearing down a connection to a database is a fairly heavyweight process. You should do this as little as possible by caching connections. Of course if you use a JDBC2 Datasource this will be done for you.