Design on connecting to db
843859May 16 2007 — edited May 18 2007Hi,
I am using SUN ONE application server as my web server and connection pooling has been configured.
I am wondering what is the best design to connect to database ( consider about the memory). From my reseach over the Internet. I saw a lot of ppls are using lookup of JNDI and storing the connection in datasource in the main entrance. Then they pass the datasource to different class which need connection. Some of them do the lookup JNDI and store in data source when each single sql is called
My concern is passing datasource to different class does it taking lots memory? What about each single sql and do the lookup n store in datasource does it consuming quite lots of time?
Any other better way on the design? Any idea is appreciate!
Thanks