I am using Tomcat database connection pool. In my java class, Do I need to close database connection after I openned the connection and retrieved data from database.
java.sql.Connection is interface, not a class, so the thing you got from pool is not actually the same what you got directly creating connection. When you call close on connection from pool, pool returns REAL connection to pool, so it become available for further reuse.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.