{"id":75569,"date":"2020-01-20T11:00:07","date_gmt":"2020-01-20T05:30:07","guid":{"rendered":"https:\/\/www.vskills.in\/certification\/tutorial\/?p=75569"},"modified":"2024-04-12T14:33:38","modified_gmt":"2024-04-12T09:03:38","slug":"database-connection-pool-dbcp-2-configurations","status":"publish","type":"page","link":"https:\/\/www.vskills.in\/certification\/tutorial\/database-connection-pool-dbcp-2-configurations\/","title":{"rendered":"Database Connection Pool (DBCP 2) Configurations"},"content":{"rendered":"<p>The default database connection pool implementation in Apache Tomcat relies on the libraries from the Apache Commons project. The following libraries are used:<\/p>\n<ul>\n<li>Commons DBCP<\/li>\n<li>Commons Pool<\/li>\n<\/ul>\n<p>These libraries are located in a single JAR at $CATALINA_HOME\/lib\/tomcat-dbcp.jar. However, only the classes needed for connection pooling have been included, and the packages have been renamed to avoid interfering with applications.<\/p>\n<p>DBCP 2.0 provides support for JDBC 4.1.<\/p>\n<p><strong>Installation<\/strong><\/p>\n<p>Preventing database connection pool leaks<\/p>\n<p>A database connection pool creates and manages a pool of connections to a database. Recycling and reusing already existing connections to a database is more efficient than opening a new connection.<\/p>\n<p>There is one problem with connection pooling. A web application has to explicitly close ResultSet&#8217;s, Statement&#8217;s, and Connection&#8217;s. Failure of a web application to close these resources can result in them never being available again for reuse, a database connection pool &#8220;leak&#8221;. This can eventually result in your web application database connections failing if there are no more available connections.<\/p>\n<p>There is a solution to this problem. The Apache Commons DBCP can be configured to track and recover these abandoned database connections. Not only can it recover them, but also generate a stack trace for the code which opened these resources and never closed them.<\/p>\n<p>To configure a DBCP DataSource so that abandoned database connections are removed and recycled add the following attribute to the Resource configuration for your DBCP DataSource:<\/p>\n<p>removeAbandoned=&#8221;true&#8221;<\/p>\n<p>When available database connections run low DBCP will recover and recycle any abandoned database connections it finds. The default is false.<\/p>\n<p>Use the removeAbandonedTimeout attribute to set the number of seconds a database connection has been idle before it is considered abandoned.<\/p>\n<p>removeAbandonedTimeout=&#8221;60&#8243;<\/p>\n<p>The default timeout for removing abandoned connections is 300 seconds.<\/p>\n<p>The logAbandoned attribute can be set to true if you want DBCP to log a stack trace of the code which abandoned the database connection resources.<\/p>\n<p>&nbsp;<\/p>\n<p>logAbandoned=&#8221;true&#8221;<\/p>\n<p>The default is false.<\/p>\n<p><strong>MySQL DBCP Example<\/strong><\/p>\n<p>Introduction<\/p>\n<ul>\n<li>Versions of MySQL and JDBC drivers that have been reported to work:<\/li>\n<li>MySQL 3.23.47, MySQL 3.23.47 using InnoDB,, MySQL 3.23.58, MySQL 4.0.1alpha<\/li>\n<li>Connector\/J 3.0.11-stable (the official JDBC Driver)<\/li>\n<li>mysql 2.0.14 (an old 3rd party JDBC Driver)<\/li>\n<\/ul>\n<p>Before you proceed, don&#8217;t forget to copy the JDBC Driver&#8217;s jar into $CATALINA_HOME\/lib.<\/p>\n<ol>\n<li>MySQL configuration<\/li>\n<\/ol>\n<p>Ensure that you follow these instructions as variations can cause problems.<\/p>\n<p>Create a new test user, a new database and a single test table. Your MySQL user must have a password assigned. The driver will fail if you try to connect with an empty password.<\/p>\n<p>&nbsp;<\/p>\n<p>mysql&gt; GRANT ALL PRIVILEGES ON *.* TO javauser@localhost<\/p>\n<p>-&gt;\u00a0\u00a0 IDENTIFIED BY &#8216;javadude&#8217; WITH GRANT OPTION;<\/p>\n<p>mysql&gt; create database javatest;<\/p>\n<p>mysql&gt; use javatest;<\/p>\n<p>mysql&gt; create table testdata (<\/p>\n<p>-&gt;\u00a0\u00a0 id int not null auto_increment primary key,<\/p>\n<p>-&gt;\u00a0\u00a0 foo varchar(25),<\/p>\n<p>-&gt;\u00a0\u00a0 bar int);<\/p>\n<p><strong>Note:<\/strong> the above user should be removed once testing is complete!<\/p>\n<p>Next insert some test data into the testdata table.<\/p>\n<p>mysql&gt; insert into testdata values(null, &#8216;hello&#8217;, 12345);<\/p>\n<p>Query OK, 1 row affected (0.00 sec)<\/p>\n<p>&nbsp;<\/p>\n<p>mysql&gt; select * from testdata;<\/p>\n<p>+&#8212;-+&#8212;&#8212;-+&#8212;&#8212;-+<\/p>\n<p>| ID | FOO\u00a0\u00a0 | BAR\u00a0\u00a0 |<\/p>\n<p>+&#8212;-+&#8212;&#8212;-+&#8212;&#8212;-+<\/p>\n<p>| 1 | hello | 12345 |<\/p>\n<p>+&#8212;-+&#8212;&#8212;-+&#8212;&#8212;-+<\/p>\n<p>1 row in set (0.00 sec)<\/p>\n<p>&nbsp;<\/p>\n<p>mysql&gt;<\/p>\n<ol start=\"2\">\n<li>Context configuration<\/li>\n<\/ol>\n<p>Configure the JNDI DataSource in Tomcat by adding a declaration for your resource to your Context.<\/p>\n<p>For example:<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;Context&gt;<\/p>\n<p>&lt;!&#8211; maxTotal: Maximum number of database connections in pool. Make sure you<\/p>\n<p>configure your mysqld max_connections large enough to handle<\/p>\n<p>all of your db connections. Set to -1 for no limit.<\/p>\n<p>&#8211;&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;!&#8211; maxIdle: Maximum number of idle database connections to retain in pool.<\/p>\n<p>Set to -1 for no limit. See also the DBCP documentation on this<\/p>\n<p>and the minEvictableIdleTimeMillis configuration parameter.<\/p>\n<p>&#8211;&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;!&#8211; maxWaitMillis: Maximum time to wait for a database connection to become available<\/p>\n<p>in ms, in this example 10 seconds. An Exception is thrown if<\/p>\n<p>this timeout is exceeded. Set to -1 to wait indefinitely.<\/p>\n<p>&#8211;&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;!&#8211; username and password: MySQL username and password for database connections &#8211;&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;!&#8211; driverClassName: Class name for the old mm.mysql JDBC driver is<\/p>\n<p>org.gjt.mm.mysql.Driver &#8211; we recommend using Connector\/J though.<\/p>\n<p>Class name for the official MySQL Connector\/J driver is com.mysql.jdbc.Driver.<\/p>\n<p>&#8211;&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;!&#8211; url: The JDBC connection url for connecting to your MySQL database.<\/p>\n<p>&#8211;&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;Resource name=&#8221;jdbc\/TestDB&#8221; auth=&#8221;Container&#8221; type=&#8221;javax.sql.DataSource&#8221;<\/p>\n<p>maxTotal=&#8221;100&#8243; maxIdle=&#8221;30&#8243; maxWaitMillis=&#8221;10000&#8243;<\/p>\n<p>username=&#8221;javauser&#8221; password=&#8221;javadude&#8221; driverClassName=&#8221;com.mysql.jdbc.Driver&#8221;<\/p>\n<p>url=&#8221;jdbc:mysql:\/\/localhost:3306\/javatest&#8221;\/&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;\/Context&gt;<\/p>\n<ol start=\"3\">\n<li>web.xml configuration<\/li>\n<\/ol>\n<p>Now create a WEB-INF\/web.xml for this test application.<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;web-app xmlns=&#8221;http:\/\/java.sun.com\/xml\/ns\/j2ee&#8221;<\/p>\n<p>xmlns:xsi=&#8221;http:\/\/www.w3.org\/2001\/XMLSchema-instance&#8221;<\/p>\n<p>xsi:schemaLocation=&#8221;http:\/\/java.sun.com\/xml\/ns\/j2ee<\/p>\n<p>http:\/\/java.sun.com\/xml\/ns\/j2ee\/web-app_2_4.xsd&#8221;<\/p>\n<p>version=&#8221;2.4&#8243;&gt;<\/p>\n<p>&lt;description&gt;MySQL Test App&lt;\/description&gt;<\/p>\n<p>&lt;resource-ref&gt;<\/p>\n<p>&lt;description&gt;DB Connection&lt;\/description&gt;<\/p>\n<p>&lt;res-ref-name&gt;jdbc\/TestDB&lt;\/res-ref-name&gt;<\/p>\n<p>&lt;res-type&gt;javax.sql.DataSource&lt;\/res-type&gt;<\/p>\n<p>&lt;res-auth&gt;Container&lt;\/res-auth&gt;<\/p>\n<p>&lt;\/resource-ref&gt;<\/p>\n<p>&lt;\/web-app&gt;<\/p>\n<ol start=\"4\">\n<li>Test code<\/li>\n<\/ol>\n<p>Now create a simple test.jsp page for use later.<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;%@ taglib uri=&#8221;http:\/\/java.sun.com\/jsp\/jstl\/sql&#8221; prefix=&#8221;sql&#8221; %&gt;<\/p>\n<p>&lt;%@ taglib uri=&#8221;http:\/\/java.sun.com\/jsp\/jstl\/core&#8221; prefix=&#8221;c&#8221; %&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;sql:query var=&#8221;rs&#8221; dataSource=&#8221;jdbc\/TestDB&#8221;&gt;<\/p>\n<p>select id, foo, bar from testdata<\/p>\n<p>&lt;\/sql:query&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;head&gt;<\/p>\n<p>&lt;title&gt;DB Test&lt;\/title&gt;<\/p>\n<p>&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;h2&gt;Results&lt;\/h2&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;c:forEach var=&#8221;row&#8221; items=&#8221;${rs.rows}&#8221;&gt;<\/p>\n<p>Foo ${row.foo}&lt;br\/&gt;<\/p>\n<p>Bar ${row.bar}&lt;br\/&gt;<\/p>\n<p>&lt;\/c:forEach&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>That JSP page makes use of JSTL&#8217;s SQL and Core taglibs. You can get it from Apache Tomcat Taglibs &#8211; Standard Tag Library project \u2014 just make sure you get a 1.1.x or later release. Once you have JSTL, copy jstl.jar andstandard.jar to your web app&#8217;s WEB-INF\/lib directory.<\/p>\n<p>Finally deploy your web app into $CATALINA_BASE\/webapps either as a warfile called DBTest.war or into a sub-directory called DBTest<\/p>\n<p>Once deployed, point a browser at http:\/\/localhost:8080\/DBTest\/test.jsp to view the fruits of your hard work.<\/p>\n<p><strong>Oracle 8i, 9i &amp; 10g<\/strong><\/p>\n<p>Introduction<\/p>\n<p>Oracle requires minimal changes from the MySQL configuration except for the usual gotchas \ud83d\ude42<\/p>\n<p>Drivers for older Oracle versions may be distributed as *.zip files rather than *.jar files. Tomcat will only use*.jar files installed in $CATALINA_HOME\/lib. Therefore classes111.zip or classes12.zip will need to be renamed with a .jar extension. Since jarfiles are zipfiles, there is no need to unzip and jar these files &#8211; a simple rename will suffice.<\/p>\n<p>For Oracle 9i onwards you should use oracle.jdbc.OracleDriver rather thanoracle.jdbc.driver.OracleDriver as Oracle have stated that oracle.jdbc.driver.OracleDriver is deprecated and support for this driver class will be discontinued in the next major release.<\/p>\n<ol>\n<li>Context configuration<\/li>\n<\/ol>\n<p>In a similar manner to the mysql config above, you will need to define your Datasource in your Context. Here we define a Datasource called myoracle using the thin driver to connect as user scott, password tiger to the sid called mysid. (Note: with the thin driver this sid is not the same as the tnsname). The schema used will be the default schema for the user scott.<\/p>\n<p>Use of the OCI driver should simply involve a changing thin to oci in the URL string.<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;Resource name=&#8221;jdbc\/myoracle&#8221; auth=&#8221;Container&#8221;<\/p>\n<p>type=&#8221;javax.sql.DataSource&#8221; driverClassName=&#8221;oracle.jdbc.OracleDriver&#8221;<\/p>\n<p>url=&#8221;jdbc:oracle:thin:@127.0.0.1:1521:mysid&#8221;<\/p>\n<p>username=&#8221;scott&#8221; password=&#8221;tiger&#8221; maxTotal=&#8221;20&#8243; maxIdle=&#8221;10&#8243;<\/p>\n<p>maxWaitMillis=&#8221;-1&#8243;\/&gt;<\/p>\n<p>&nbsp;<\/p>\n<ol start=\"2\">\n<li>web.xml configuration<\/li>\n<\/ol>\n<p>You should ensure that you respect the element ordering defined by the DTD when you create you applications web.xml file.<\/p>\n<p>&lt;resource-ref&gt;<\/p>\n<p>&lt;description&gt;Oracle Datasource example&lt;\/description&gt;<\/p>\n<p>&lt;res-ref-name&gt;jdbc\/myoracle&lt;\/res-ref-name&gt;<\/p>\n<p>&lt;res-type&gt;javax.sql.DataSource&lt;\/res-type&gt;<\/p>\n<p>&lt;res-auth&gt;Container&lt;\/res-auth&gt;<\/p>\n<p>&lt;\/resource-ref&gt;<\/p>\n<p>&nbsp;<\/p>\n<ol start=\"3\">\n<li>Code example<\/li>\n<\/ol>\n<p>You can use the same example application as above (assuming you create the required DB instance, tables etc.) replacing the Datasource code with something like<\/p>\n<p>Context initContext = new InitialContext();<\/p>\n<p>Context envContext = (Context)initContext.lookup(&#8220;java:\/comp\/env&#8221;);<\/p>\n<p>DataSource ds = (DataSource)envContext.lookup(&#8220;jdbc\/myoracle&#8221;);<\/p>\n<p>Connection conn = ds.getConnection();<\/p>\n<p>\/\/etc.<\/p>\n<p><strong>PostgreSQL<\/strong><\/p>\n<p>Introduction<\/p>\n<p>PostgreSQL is configured in a similar manner to Oracle.<\/p>\n<ol>\n<li>Required files<\/li>\n<\/ol>\n<p>Copy the Postgres JDBC jar to $CATALINA_HOME\/lib. As with Oracle, the jars need to be in this directory in order for DBCP&#8217;s Classloader to find them. This has to be done regardless of which configuration step you take next.<\/p>\n<p>&nbsp;<\/p>\n<ol start=\"2\">\n<li>Resource configuration<\/li>\n<\/ol>\n<p>You have two choices here: define a datasource that is shared across all Tomcat applications, or define a datasource specifically for one application.<\/p>\n<p>&nbsp;<\/p>\n<p>2a. Shared resource configuration<\/p>\n<p>Use this option if you wish to define a datasource that is shared across multiple Tomcat applications, or if you just prefer defining your datasource in this file.<\/p>\n<p>This author has not had success here, although others have reported so. Clarification would be appreciated here.<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;Resource name=&#8221;jdbc\/postgres&#8221; auth=&#8221;Container&#8221;<\/p>\n<p>type=&#8221;javax.sql.DataSource&#8221; driverClassName=&#8221;org.postgresql.Driver&#8221;<\/p>\n<p>url=&#8221;jdbc:postgresql:\/\/127.0.0.1:5432\/mydb&#8221;<\/p>\n<p>username=&#8221;myuser&#8221; password=&#8221;mypasswd&#8221; maxTotal=&#8221;20&#8243; maxIdle=&#8221;10&#8243; maxWaitMillis=&#8221;-1&#8243;\/&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>2b. Application-specific resource configuration<\/p>\n<p>Use this option if you wish to define a datasource specific to your application, not visible to other Tomcat applications. This method is less invasive to your Tomcat installation.<\/p>\n<p>Create a resource definition for your Context. The Context element should look something like the following.<\/p>\n<p>&lt;Context&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;Resource name=&#8221;jdbc\/postgres&#8221; auth=&#8221;Container&#8221;<\/p>\n<p>type=&#8221;javax.sql.DataSource&#8221; driverClassName=&#8221;org.postgresql.Driver&#8221;<\/p>\n<p>url=&#8221;jdbc:postgresql:\/\/127.0.0.1:5432\/mydb&#8221;<\/p>\n<p>username=&#8221;myuser&#8221; password=&#8221;mypasswd&#8221; maxTotal=&#8221;20&#8243; maxIdle=&#8221;10&#8243;<\/p>\n<p>maxWaitMillis=&#8221;-1&#8243;\/&gt;<\/p>\n<p>&lt;\/Context&gt;<\/p>\n<ol start=\"3\">\n<li>web.xml configuration<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>&lt;resource-ref&gt;<\/p>\n<p>&lt;description&gt;postgreSQL Datasource example&lt;\/description&gt;<\/p>\n<p>&lt;res-ref-name&gt;jdbc\/postgres&lt;\/res-ref-name&gt;<\/p>\n<p>&lt;res-type&gt;javax.sql.DataSource&lt;\/res-type&gt;<\/p>\n<p>&lt;res-auth&gt;Container&lt;\/res-auth&gt;<\/p>\n<p>&lt;\/resource-ref&gt;<\/p>\n<ol start=\"4\">\n<li>Accessing the datasource<\/li>\n<\/ol>\n<p>When accessing the datasource programmatically, remember to prepend java:\/comp\/env to your JNDI lookup, as in the following snippet of code. Note also that &#8220;jdbc\/postgres&#8221; can be replaced with any value you prefer, provided you change it in the above resource definition file as well.<\/p>\n<p>&nbsp;<\/p>\n<p>InitialContext cxt = new InitialContext();<\/p>\n<p>if ( cxt == null ) {<\/p>\n<p>throw new Exception(&#8220;Uh oh &#8212; no context!&#8221;);<\/p>\n<p>}<\/p>\n<p>&nbsp;<\/p>\n<p>DataSource ds = (DataSource) cxt.lookup( &#8220;java:\/comp\/env\/jdbc\/postgres&#8221; );<\/p>\n<p>&nbsp;<\/p>\n<p>if ( ds == null ) {<\/p>\n<p>throw new Exception(&#8220;Data source not found!&#8221;);<\/p>\n<p>}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The default database connection pool implementation in Apache Tomcat relies on the libraries from the Apache Commons project. The following libraries are used: Commons DBCP Commons Pool These libraries are located in a single JAR at $CATALINA_HOME\/lib\/tomcat-dbcp.jar. However, only the classes needed for connection pooling have been included, and the packages have been renamed to&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[8678],"tags":[8726],"class_list":["post-75569","page","type-page","status-publish","hentry","category-tomcat","tag-database-connection-pool-dbcp-2-configurations"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Database Connection Pool (DBCP 2) Configurations - Tutorial<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vskills.in\/certification\/tutorial\/database-connection-pool-dbcp-2-configurations\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Database Connection Pool (DBCP 2) Configurations - Tutorial\" \/>\n<meta property=\"og:description\" content=\"The default database connection pool implementation in Apache Tomcat relies on the libraries from the Apache Commons project. The following libraries are used: Commons DBCP Commons Pool These libraries are located in a single JAR at $CATALINA_HOME\/lib\/tomcat-dbcp.jar. However, only the classes needed for connection pooling have been included, and the packages have been renamed to...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vskills.in\/certification\/tutorial\/database-connection-pool-dbcp-2-configurations\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorial\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/vskills.in\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-12T09:03:38+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/database-connection-pool-dbcp-2-configurations\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/database-connection-pool-dbcp-2-configurations\/\",\"name\":\"Database Connection Pool (DBCP 2) Configurations - Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\"},\"datePublished\":\"2020-01-20T05:30:07+00:00\",\"dateModified\":\"2024-04-12T09:03:38+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/database-connection-pool-dbcp-2-configurations\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vskills.in\/certification\/tutorial\/database-connection-pool-dbcp-2-configurations\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/database-connection-pool-dbcp-2-configurations\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Database Connection Pool (DBCP 2) Configurations\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"name\":\"Tutorial\",\"description\":\"Vskills - A initiative in elearning and certification\",\"publisher\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\",\"name\":\"Vskills\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"contentUrl\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"width\":73,\"height\":55,\"caption\":\"Vskills\"},\"image\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/vskills.in\/\",\"https:\/\/x.com\/vskills_in\",\"https:\/\/www.linkedin.com\/company-beta\/1371554\/\",\"https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Database Connection Pool (DBCP 2) Configurations - Tutorial","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.vskills.in\/certification\/tutorial\/database-connection-pool-dbcp-2-configurations\/","og_locale":"en_US","og_type":"article","og_title":"Database Connection Pool (DBCP 2) Configurations - Tutorial","og_description":"The default database connection pool implementation in Apache Tomcat relies on the libraries from the Apache Commons project. The following libraries are used: Commons DBCP Commons Pool These libraries are located in a single JAR at $CATALINA_HOME\/lib\/tomcat-dbcp.jar. However, only the classes needed for connection pooling have been included, and the packages have been renamed to...","og_url":"https:\/\/www.vskills.in\/certification\/tutorial\/database-connection-pool-dbcp-2-configurations\/","og_site_name":"Tutorial","article_publisher":"https:\/\/www.facebook.com\/vskills.in\/","article_modified_time":"2024-04-12T09:03:38+00:00","twitter_misc":{"Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/database-connection-pool-dbcp-2-configurations\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/database-connection-pool-dbcp-2-configurations\/","name":"Database Connection Pool (DBCP 2) Configurations - Tutorial","isPartOf":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website"},"datePublished":"2020-01-20T05:30:07+00:00","dateModified":"2024-04-12T09:03:38+00:00","breadcrumb":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/database-connection-pool-dbcp-2-configurations\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vskills.in\/certification\/tutorial\/database-connection-pool-dbcp-2-configurations\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/database-connection-pool-dbcp-2-configurations\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vskills.in\/certification\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Database Connection Pool (DBCP 2) Configurations"}]},{"@type":"WebSite","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","name":"Tutorial","description":"Vskills - A initiative in elearning and certification","publisher":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization","name":"Vskills","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","contentUrl":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","width":73,"height":55,"caption":"Vskills"},"image":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/vskills.in\/","https:\/\/x.com\/vskills_in","https:\/\/www.linkedin.com\/company-beta\/1371554\/","https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw"]}]}},"_links":{"self":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/75569","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/comments?post=75569"}],"version-history":[{"count":3,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/75569\/revisions"}],"predecessor-version":[{"id":76421,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/75569\/revisions\/76421"}],"wp:attachment":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/media?parent=75569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/categories?post=75569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/tags?post=75569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}