Is a factory attribute required for tomcat server.xml?

I read more about JNDI in tomcat, and I read from a few resources that you need to link to factory. They say its often assumed to be "org.apache.tomcat.jdbc.pool.DataSourceFactory". However, most often I see something like this -

<Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="javauser" password="javadude" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/javatest"/> 

So what does tomcat do in this case? By default, is "org.apache.tomcat.jdbc.pool.DataSourceFactory"?

+4
source share
1 answer

org.apache.tomcat.jdbc.pool.DataSourceFactory not the factory default. This is the new Tomcat 7.0 built - in high - performance connection pool , which is supposed to replace the default DBCP.

By default, the factory is org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory . See Also JNDI Resources HOW> . The attribute is really not required.

+6
source

Source: https://habr.com/ru/post/1336809/


All Articles