java - Are javax.servlet-api and commons-dbcp important in our Spring Apps? -


how understand importance of javax.servlet-api , commons-dbcp in our spring application.

when must use , implementation should do?

because have build.gradle this

dependencies {     //compile('javax.servlet:javax.servlet-api:3.1.0')     //compile('commons-dbcp:commons-dbcp:1.4')      compile('org.springframework.boot:spring-boot-starter-thymeleaf')     compile('org.springframework.boot:spring-boot-starter-data-jpa')      compile('mysql:mysql-connector-java:5.1.31')      compile('com.google.code.gson:gson:2.4')      testcompile("org.springframework.boot:spring-boot-starter-test") } 

if remove javax.servlet-api , commons-dbcp build.gradle, application can still run expected.

and (javax.servlet-api , commons-dbcp) in behind of scene?

maybe know why, because it's has been covered out-of-the-box spring boot starter. but, explanation it, can't found anywhere.

you don't need dependencies. javax.servlet-api provided tomcat. commons-dbcp connection pool, tomcat includes it's own connection pool transitive dependency.
gradle dependencyinsight --dependency tomcat-jdbc output:

org.apache.tomcat:tomcat-jdbc:8.0.30 (selected rule) \--- org.springframework.boot:spring-boot-starter-jdbc:1.3.1.release      \--- org.springframework.boot:spring-boot-starter-data-jpa:1.3.1.release 

you should use tomcat connection pool.

we prefer tomcat pooling datasource performance , concurrency, if available choose it.

spring-boot documentation


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -