I am learning
Struts so appreciate if someone can clarify if my understanding is correct:
(1) <data-sources> element of struts-config.xml is to config a datasource managed by struts internally and is INDEPENDENT OF
Tomcat. So if we specify:
<data-sources>
<data-source type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="driverClassName" value="oracle.jdbc.OracleDriver" />
<set-property property="url" value="jdbc
racle:thin:@myhost:1521
DB" />
<set-property property="username" value="scott"/>
<set-property property="password" value="tiger"/>
</data-source>
</data-sources>
then the datasource is Jakarta's dbcp connection pooling which provides connection pooling independent of Tomcat.
(2) We can also use Tomcat to provide connection pooling. In that case we dont need to use <data-sources> in struts-config.xml at all. Instead, we use JNDI in each Action to lookup a datasource and get the connection. The connection so returned is transparently pooled.
Are my 2 points above correct?