Originally posted by Anil Verghese:
Is using struts datasource efficient way to do the connection pooling if not can any one suggest a better way to do this
No, it is not, nor does it facilitate the Model/View/Controller model that Struts is trying to promote. It is mainly for this reason that the Struts Datasource utility has been removed from later versions.
The best practice for using data in
J2EE applications is to set up the data source using application server utilities that place a reference to it in the Java Naming and Directory Interface (JNDI). In your application code, you would then retrieve this reference with a JNDI lookup.
The preferred method for setting up a JNDI datasource is different for each application server. Look in the documentation for your application server under a heading such as "JNDI DataSource".
For more information on this topic, read chapter 31 of the
Sun J2EE Tutorial