{"id":48784,"date":"2017-07-28T11:00:51","date_gmt":"2017-07-28T08:00:51","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=48784"},"modified":"2019-03-05T13:06:51","modified_gmt":"2019-03-05T11:06:51","slug":"jdbc-connection-pool-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/","title":{"rendered":"JDBC Connection Pool Example"},"content":{"rendered":"<p><strong>Connection pooling<\/strong> is a mechanism to create and maintain a collection of JDBC connection objects. The primary objective of maintaining the pool of connection object is to leverage re-usability and improve the overall performance of the application.<\/p>\n<p>In this article, we will try to show how connection pooling mechanism can be applied to a Java application.<\/p>\n<h2>1. Introduction<\/h2>\n<p>JDBC stands for <strong>Java Database Connectivity<\/strong>, which is a standard Java API for database-independent connectivity between the Java programming language and a wide range of databases.<br \/>\n&nbsp;<\/p>\n<p>&nbsp;<br \/>\nThe JDBC library includes API for each of the tasks commonly associated with the database usage:<\/p>\n<ul>\n<li>Making a connection to the database.<\/li>\n<li>Creating SQL statements.<\/li>\n<li>Executing SQL queries in the database.<\/li>\n<li>Viewing and Modifying the resulting records.<\/li>\n<\/ul>\n<h3>1.1 JDBC Connection Pooling<\/h3>\n<p><strong>Connection pooling<\/strong> is a process where we maintain a <em>cache of database connections<\/em> and has become the standard for middleware database drivers. The process of creating a connection, always an expensive, time-consuming operation, is multiplied in these environments where a large number of users are accessing the database in short, unconnected operations. Creating connections over and over in these environments is simply too expensive.<\/p>\n<p>A connection pool operates by performing the work of creating connections ahead of time. In the case of a JDBC connection pool, a pool of <code>Connection<\/code> objects are created at the time the application server starts. These objects are then managed by a <strong>pool manager<\/strong> that disperses connections as they are requested by clients and returns them to the pool when it determines the client is finished with the <code>Connection<\/code> object. A great deal of housekeeping is involved in managing these connections.<\/p>\n<p>When the connection pool server starts, it creates a predetermined number of <code>Connection<\/code> objects. A client application would then perform a lookup to retrieve a reference to a <code>DataSource<\/code> object that implements the <code>ConnectionPoolDataSource<\/code> interface. The client application would not need to make any special provisions to use the pooled data source; the code would be no different from code written for a non-pooled <code>DataSource<\/code>.<\/p>\n<p>When the client application requests a connection from the <code>ConnectionPoolDataSource<\/code>, the data source implementation would retrieve a physical connection to the client application. The <code>ConnectionPoolDataSource<\/code> would return a <code>Connection<\/code> object that implemented the <code>PooledConnection<\/code> interface.<\/p>\n<p>The <code>PooledConnection<\/code> interface dictates the use of <em>event<\/em> listeners. These event listeners allow the connection pool manager to capture important connection events, such as attempts by the client application to close the connection. When the driver traps a close-connection event, it intercedes and performs a pseudo-close operation that merely takes the <code>Connection<\/code> object, returns it to the pool of available connection, and performs any housekeeping that is necessary.<\/p>\n<p>The operation of the connection pool should be completely transparent to the client application. The triggering of connection events, the manipulation of the object pool, and the creation and destruction of physical connections are all managed by the pool manager. The activities of the connection pool are, however, configurable by the application developer.<\/p>\n<h3>1.2 Download and Install MySQL<\/h3>\n<p>You can watch <a href=\"https:\/\/www.youtube.com\/watch?v=z1t9m7K6cpI\" target=\"_blank\" rel=\"noopener noreferrer\">this<\/a> video in order to download and install the MySQL database on your windows operations system.<\/p>\n<p>Now, open up the Eclipse IDE and let\u2019s start building the application!<\/p>\n<h2>2. JDBC Connection Pool Example<\/h2>\n<h3>2.1 Tools Used<\/h3>\n<p>We are using Eclipse Kepler SR2, JDK 8, MySQL database and Maven (to download the MySQL connector jar and Connection Pool libraries). Having said that, we have tested the code against JDK 1.7 and it works well.<\/p>\n<h3>2.2 Project Structure<\/h3>\n<p>Firstly, let\u2019s review the final project structure, in case you are confused about where you should create the corresponding files or folder later!<\/p>\n<p><figure id=\"attachment_48786\" aria-describedby=\"caption-attachment-48786\" style=\"width: 282px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-structure.jpg\"><img decoding=\"async\" class=\"size-full wp-image-48786\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-structure.jpg\" alt=\"Fig. 1: JDBC Connection Pool Application Project Structure\" width=\"282\" height=\"306\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-structure.jpg 282w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-structure-276x300.jpg 276w\" sizes=\"(max-width: 282px) 100vw, 282px\" \/><\/a><figcaption id=\"caption-attachment-48786\" class=\"wp-caption-text\">Fig. 1: JDBC Connection Pool Application Project Structure<\/figcaption><\/figure><\/p>\n<h3>2.3 Project Creation<\/h3>\n<p>This section will demonstrate on how to create a Dynamic Web Java Maven project with Eclipse. In Eclipse IDE, go to <code>File -&gt; New -&gt; Maven Project<\/code><\/p>\n<p><figure id=\"attachment_48789\" aria-describedby=\"caption-attachment-48789\" style=\"width: 652px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-1.jpg\"><img decoding=\"async\" class=\"size-full wp-image-48789\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-1.jpg\" alt=\"Fig. 2: Create Maven Project\" width=\"652\" height=\"712\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-1.jpg 652w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-1-275x300.jpg 275w\" sizes=\"(max-width: 652px) 100vw, 652px\" \/><\/a><figcaption id=\"caption-attachment-48789\" class=\"wp-caption-text\">Fig. 2: Create Maven Project<\/figcaption><\/figure><div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>In the New Maven Project window, it will ask you to select project location. By default, &#8216;<em>Use default workspace location<\/em>&#8216; will be selected. Select the &#8216;<em>Create a simple project (skip archetype selection)<\/em>&#8216; checkbox and just click on next button to proceed.<\/p>\n<p><figure id=\"attachment_48809\" aria-describedby=\"caption-attachment-48809\" style=\"width: 804px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-2-1.jpg\"><img decoding=\"async\" class=\"size-full wp-image-48809\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-2-1.jpg\" alt=\"Fig. 3: Project Details\" width=\"804\" height=\"541\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-2-1.jpg 804w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-2-1-300x202.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-2-1-768x517.jpg 768w\" sizes=\"(max-width: 804px) 100vw, 804px\" \/><\/a><figcaption id=\"caption-attachment-48809\" class=\"wp-caption-text\">Fig. 3: Project Details<\/figcaption><\/figure><\/p>\n<p>It will ask you to &#8216;Enter a group id for the artifact.&#8217; We will input the details as shown in the below image. The version number will be by default <code>0.0.1-SNAPSHOT<\/code>.<\/p>\n<p><figure id=\"attachment_48791\" aria-describedby=\"caption-attachment-48791\" style=\"width: 803px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-3.jpg\"><img decoding=\"async\" class=\"size-full wp-image-48791\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-3.jpg\" alt=\"Fig. 4: Archetype Parameters\" width=\"803\" height=\"542\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-3.jpg 803w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-3-300x202.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-3-768x518.jpg 768w\" sizes=\"(max-width: 803px) 100vw, 803px\" \/><\/a><figcaption id=\"caption-attachment-48791\" class=\"wp-caption-text\">Fig. 4: Archetype Parameters<\/figcaption><\/figure><\/p>\n<p>Click on Finish and now creating a maven project is completed. If you observe, it has downloaded the maven dependencies and a <code>pom.xml<\/code> file will be created. It will have the following code:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>pom.xml<\/em><\/span><\/p>\n<pre class=\"brush:xml; wrap-lines:false;\">&lt;project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\" xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\"&gt;\n\t&lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\n\t&lt;groupId&gt;JdbcPool&lt;\/groupId&gt;\n\t&lt;artifactId&gt;JdbcPool&lt;\/artifactId&gt;\n\t&lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt;\n&lt;\/project&gt;\n<\/pre>\n<p>We can start adding the dependencies that developers want like MySQL, Connection Pooling jars etc. Let\u2019s start building the application!<\/p>\n<h2>3. Application Building<\/h2>\n<p>Below are the steps involved in developing this application:<\/p>\n<h3>3.1 Database &amp; Table Creation<\/h3>\n<p>This tutorial uses a database called <code>tutorialDb<\/code> . The database is not included when you create the project in Eclipse so you first need to create the database to follow this tutorial:<\/p>\n<ul>\n<li>Create a new database <code>tutorialDb<\/code> as:<\/li>\n<\/ul>\n<pre class=\"brush:sql;\">CREATE DATABASE tutorialDb;\n<\/pre>\n<ul>\n<li>Use the created database <code>tutorialDb<\/code> to create table as:<\/li>\n<\/ul>\n<pre class=\"brush:sql;\">USE tutorialDb;\n<\/pre>\n<ul>\n<li>Create the table <code>technical_editors<\/code> as shown below:<\/li>\n<\/ul>\n<pre class=\"brush:sql; wrap-lines:false;\">CREATE TABLE technical_editors (tech_id int(11) NOT NULL AUTO_INCREMENT, tech_username varchar(20) DEFAULT NULL, PRIMARY KEY (tech_id));\n<\/pre>\n<ul>\n<li>Now we shall insert some values into the <code>technical_editors<\/code> table as:<\/li>\n<\/ul>\n<pre class=\"&quot;brush:sql;\">INSERT INTO technical_editors (tech_id, tech_username) VALUES (1, 'Java Code Geek');\n\nINSERT INTO technical_editors (tech_id, tech_username) VALUES (2, 'Harry Potter');\n<\/pre>\n<p>If everything goes well, the table will be shown as below in the MySQL workbench,<\/p>\n<p><figure id=\"attachment_48792\" aria-describedby=\"caption-attachment-48792\" style=\"width: 849px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-connection-pool-database-output-1.jpg\"><img decoding=\"async\" class=\"size-full wp-image-48792\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-connection-pool-database-output-1.jpg\" alt=\"Fig. 5: Database and Table Creation\" width=\"849\" height=\"565\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-connection-pool-database-output-1.jpg 849w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-connection-pool-database-output-1-300x200.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-connection-pool-database-output-1-768x511.jpg 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/a><figcaption id=\"caption-attachment-48792\" class=\"wp-caption-text\">Fig. 5: Database and Table Creation<\/figcaption><\/figure><\/p>\n<h3>3.2 Maven Dependencies<\/h3>\n<p>In this example, we are using latest MySQL version i.e. <code>mysql-connector-java-5.1.41<\/code> and connection pooling dependencies. The <strong>updated<\/strong> file will have the following code:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>pom.xml<\/em><\/span><\/p>\n<pre class=\"brush:xml; wrap-lines:false;\">&lt;project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\" xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\"&gt;\n\t&lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\n\t&lt;groupId&gt;JdbcPool&lt;\/groupId&gt;\n\t&lt;artifactId&gt;JdbcPool&lt;\/artifactId&gt;\n\t&lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt;\n\t&lt;packaging&gt;jar&lt;\/packaging&gt;\n\t&lt;dependencies&gt;\n\t\t&lt;dependency&gt;\n\t\t\t&lt;groupId&gt;mysql&lt;\/groupId&gt;\n\t\t\t&lt;artifactId&gt;mysql-connector-java&lt;\/artifactId&gt;\n\t\t\t&lt;version&gt;5.1.41&lt;\/version&gt;\n\t\t&lt;\/dependency&gt;\n\t\t&lt;dependency&gt;\n\t\t\t&lt;groupId&gt;commons-dbcp&lt;\/groupId&gt;\n\t\t\t&lt;artifactId&gt;commons-dbcp&lt;\/artifactId&gt;\n\t\t\t&lt;version&gt;1.4&lt;\/version&gt;\n\t\t&lt;\/dependency&gt;\n\t&lt;\/dependencies&gt;\n&lt;\/project&gt;\n<\/pre>\n<h3>3.3 Java Class Creation<\/h3>\n<p>Let\u2019s create the required java files. Right click on <code>src\/main\/java<\/code> folder, <code>New -&gt; Package<\/code><\/p>\n<p><figure id=\"attachment_48793\" aria-describedby=\"caption-attachment-48793\" style=\"width: 636px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-4.jpg\"><img decoding=\"async\" class=\"size-full wp-image-48793\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-4.jpg\" alt=\"Fig. 6: Java Package Creation\" width=\"636\" height=\"662\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-4.jpg 636w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-4-288x300.jpg 288w\" sizes=\"(max-width: 636px) 100vw, 636px\" \/><\/a><figcaption id=\"caption-attachment-48793\" class=\"wp-caption-text\">Fig. 6: Java Package Creation<\/figcaption><\/figure>[ulp id=&#8217;TD36VgQCKfhTAygK&#8217;]<\/p>\n<p>A new pop window will open where we will enter the package name as <code>com.jcg.jdbc.connection.pooling<\/code><\/p>\n<p><figure id=\"attachment_48794\" aria-describedby=\"caption-attachment-48794\" style=\"width: 518px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-5.jpg\"><img decoding=\"async\" class=\"size-full wp-image-48794\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-5.jpg\" alt=\"Fig. 7: Java Package Name (com.jcg.jdbc.connection.pooling)\" width=\"518\" height=\"428\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-5.jpg 518w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-5-300x248.jpg 300w\" sizes=\"(max-width: 518px) 100vw, 518px\" \/><\/a><figcaption id=\"caption-attachment-48794\" class=\"wp-caption-text\">Fig. 7: Java Package Name (com.jcg.jdbc.connection.pooling)<\/figcaption><\/figure><\/p>\n<p>Once the package is created in the application, we will need to create the required implementation class. Right click on the newly created package, <code>New -&gt; Class<\/code><\/p>\n<p><figure id=\"attachment_48795\" aria-describedby=\"caption-attachment-48795\" style=\"width: 772px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-6.jpg\"><img decoding=\"async\" class=\"size-full wp-image-48795\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-6.jpg\" alt=\"Fig. 8: Java Class Creation\" width=\"772\" height=\"661\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-6.jpg 772w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-6-300x257.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-6-768x658.jpg 768w\" sizes=\"(max-width: 772px) 100vw, 772px\" \/><\/a><figcaption id=\"caption-attachment-48795\" class=\"wp-caption-text\">Fig. 8: Java Class Creation<\/figcaption><\/figure><\/p>\n<p>A new pop window will open and enter the file name as <code>ConnectionPool<\/code>. The implementation class will be created inside the package: <code>com.jcg.jdbc.connection.pooling<\/code><\/p>\n<p><figure id=\"attachment_48796\" aria-describedby=\"caption-attachment-48796\" style=\"width: 535px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-7.jpg\"><img decoding=\"async\" class=\"size-full wp-image-48796\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-7.jpg\" alt=\"Fig. 9: Java Class (ConnectionPool.java)\" width=\"535\" height=\"632\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-7.jpg 535w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-guide-7-254x300.jpg 254w\" sizes=\"(max-width: 535px) 100vw, 535px\" \/><\/a><figcaption id=\"caption-attachment-48796\" class=\"wp-caption-text\">Fig. 9: Java Class (ConnectionPool.java)<\/figcaption><\/figure><\/p>\n<h4>3.3.1 Implementation of Main Class<\/h4>\n<p>In this class, we are using the <code><a href=\"https:\/\/commons.apache.org\/proper\/commons-pool\/apidocs\/org\/apache\/commons\/pool2\/impl\/GenericObjectPool.html\" target=\"_blank\" rel=\"noopener noreferrer\">GenericObjectPool<\/a><\/code> that provides robust pooling functionality for arbitrary objects and will have the <code>main()<\/code> method to execute the application. Add the following code to it:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>ConnectionPool.java<\/em><\/span><\/p>\n<pre class=\"brush:java; wrap-lines:false;\">package com.jcg.jdbc.connection.pooling;\n\nimport java.sql.Connection;\nimport java.sql.PreparedStatement;\nimport java.sql.ResultSet;\n\nimport javax.sql.DataSource;\n\nimport org.apache.commons.dbcp.ConnectionFactory;\nimport org.apache.commons.dbcp.DriverManagerConnectionFactory;\nimport org.apache.commons.dbcp.PoolableConnectionFactory;\nimport org.apache.commons.dbcp.PoolingDataSource;\nimport org.apache.commons.pool.impl.GenericObjectPool;\n\npublic class ConnectionPool {\n\n\t\/\/ JDBC Driver Name &amp; Database URL\n\tstatic final String JDBC_DRIVER = \"com.mysql.jdbc.Driver\";  \n\tstatic final String JDBC_DB_URL = \"jdbc:mysql:\/\/localhost:3306\/tutorialDb\";\n\n\t\/\/ JDBC Database Credentials\n\tstatic final String JDBC_USER = \"root\";\n\tstatic final String JDBC_PASS = \"admin@123\";\n\n\tprivate static GenericObjectPool gPool = null;\n\n\t@SuppressWarnings(\"unused\")\n\tpublic DataSource setUpPool() throws Exception {\n\t\tClass.forName(JDBC_DRIVER);\n\n\t\t\/\/ Creates an Instance of GenericObjectPool That Holds Our Pool of Connections Object!\n\t\tgPool = new GenericObjectPool();\n\t\tgPool.setMaxActive(5);\n\n\t\t\/\/ Creates a ConnectionFactory Object Which Will Be Use by the Pool to Create the Connection Object!\n\t\tConnectionFactory cf = new DriverManagerConnectionFactory(JDBC_DB_URL, JDBC_USER, JDBC_PASS);\n\n\t\t\/\/ Creates a PoolableConnectionFactory That Will Wraps the Connection Object Created by the ConnectionFactory to Add Object Pooling Functionality!\n\t\tPoolableConnectionFactory pcf = new PoolableConnectionFactory(cf, gPool, null, null, false, true);\n\t\treturn new PoolingDataSource(gPool);\n\t}\n\n\tpublic GenericObjectPool getConnectionPool() {\n\t\treturn gPool;\n\t}\n\n\t\/\/ This Method Is Used To Print The Connection Pool Status\n\tprivate void printDbStatus() {\n\t\tSystem.out.println(\"Max.: \" + getConnectionPool().getMaxActive() + \"; Active: \" + getConnectionPool().getNumActive() + \"; Idle: \" + getConnectionPool().getNumIdle());\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tResultSet rsObj = null;\n\t\tConnection connObj = null;\n\t\tPreparedStatement pstmtObj = null;\n\t\tConnectionPool jdbcObj = new ConnectionPool();\n\t\ttry {\t\n\t\t\tDataSource dataSource = jdbcObj.setUpPool();\n\t\t\tjdbcObj.printDbStatus();\n\n\t\t\t\/\/ Performing Database Operation!\n\t\t\tSystem.out.println(\"\\n=====Making A New Connection Object For Db Transaction=====\\n\");\n\t\t\tconnObj = dataSource.getConnection();\n\t\t\tjdbcObj.printDbStatus(); \n\n\t\t\tpstmtObj = connObj.prepareStatement(\"SELECT * FROM technical_editors\");\n\t\t\trsObj = pstmtObj.executeQuery();\n\t\t\twhile (rsObj.next()) {\n\t\t\t\tSystem.out.println(\"Username: \" + rsObj.getString(\"tech_username\"));\n\t\t\t}\n\t\t\tSystem.out.println(\"\\n=====Releasing Connection Object To Pool=====\\n\");\t\t\t\n\t\t} catch(Exception sqlException) {\n\t\t\tsqlException.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\t\/\/ Closing ResultSet Object\n\t\t\t\tif(rsObj != null) {\n\t\t\t\t\trsObj.close();\n\t\t\t\t}\n\t\t\t\t\/\/ Closing PreparedStatement Object\n\t\t\t\tif(pstmtObj != null) {\n\t\t\t\t\tpstmtObj.close();\n\t\t\t\t}\n\t\t\t\t\/\/ Closing Connection Object\n\t\t\t\tif(connObj != null) {\n\t\t\t\t\tconnObj.close();\n\t\t\t\t}\n\t\t\t} catch(Exception sqlException) {\n\t\t\t\tsqlException.printStackTrace();\n\t\t\t}\n\t\t}\n\t\tjdbcObj.printDbStatus();\n\t}\n}\n<\/pre>\n<h2>4. Run the Application<\/h2>\n<p>To run the application, Right click on the <code>ConnectionPool<\/code> class, <code>Run As -&gt; Java Application<\/code>.<\/p>\n<p><figure id=\"attachment_48799\" aria-describedby=\"caption-attachment-48799\" style=\"width: 846px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-deploy-1-1.jpg\"><img decoding=\"async\" class=\"size-full wp-image-48799\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-deploy-1-1.jpg\" alt=\"Fig. 10: Run Application\" width=\"846\" height=\"703\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-deploy-1-1.jpg 846w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-deploy-1-1-300x249.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdbc-pooling-project-deploy-1-1-768x638.jpg 768w\" sizes=\"(max-width: 846px) 100vw, 846px\" \/><\/a><figcaption id=\"caption-attachment-48799\" class=\"wp-caption-text\">Fig. 10: Run Application<\/figcaption><\/figure><\/p>\n<h2>5. Project Demo<\/h2>\n<p>The code shows the following status as output:<\/p>\n<p><figure id=\"attachment_48800\" aria-describedby=\"caption-attachment-48800\" style=\"width: 849px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdb-connection-pool-project-demo-1.jpg\"><img decoding=\"async\" class=\"size-full wp-image-48800\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdb-connection-pool-project-demo-1.jpg\" alt=\"Fig. 11: Project Output\" width=\"849\" height=\"161\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdb-connection-pool-project-demo-1.jpg 849w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdb-connection-pool-project-demo-1-300x57.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/jdb-connection-pool-project-demo-1-768x146.jpg 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/a><figcaption id=\"caption-attachment-48800\" class=\"wp-caption-text\">Fig. 11: Project Output<\/figcaption><\/figure><\/p>\n<p>That\u2019s all for this post. Happy Learning!!<\/p>\n<h2>6. Conclusion<\/h2>\n<p>Here, we understood what is connection pooling and how we can implement the same using the <code>DBCP<\/code> library.<\/p>\n<h2>7. Download the Eclipse Project<\/h2>\n<p>This was an example of JDBC Connection Pooling.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/JDBC-Connection-Pooling.zip\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>JDBC Connection Pooling<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Connection pooling is a mechanism to create and maintain a collection of JDBC connection objects. The primary objective of maintaining the pool of connection object is to leverage re-usability and improve the overall performance of the application. In this article, we will try to show how connection pooling mechanism can be applied to a Java &hellip;<\/p>\n","protected":false},"author":119,"featured_media":1204,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[53],"tags":[189,216,844],"class_list":["post-48784","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sql","tag-core-java-2","tag-jdbc-2","tag-poolableconnection"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JDBC Connection Pool Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"In this article, we will try to show how does the JDBC connection pooling mechanism can be applied to a Java application.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JDBC Connection Pool Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"In this article, we will try to show how does the JDBC connection pooling mechanism can be applied to a Java application.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2017-07-28T08:00:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-03-05T11:06:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Yatin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Yatin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/\"},\"author\":{\"name\":\"Yatin\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13\"},\"headline\":\"JDBC Connection Pool Example\",\"datePublished\":\"2017-07-28T08:00:51+00:00\",\"dateModified\":\"2019-03-05T11:06:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/\"},\"wordCount\":1167,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\",\"keywords\":[\"core java\",\"jdbc\",\"poolableConnection\"],\"articleSection\":[\"sql\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/\",\"name\":\"JDBC Connection Pool Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\",\"datePublished\":\"2017-07-28T08:00:51+00:00\",\"dateModified\":\"2019-03-05T11:06:51+00:00\",\"description\":\"In this article, we will try to show how does the JDBC connection pooling mechanism can be applied to a Java application.\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"Bipartite Graph\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java Development\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Core Java\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"sql\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/sql\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"JDBC Connection Pool Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13\",\"name\":\"Yatin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg\",\"caption\":\"Yatin\"},\"description\":\"An experience full-stack engineer well versed with Core Java, Spring\/Springboot, MVC, Security, AOP, Frontend (Angular &amp; React), and cloud technologies (such as AWS, GCP, Jenkins, Docker, K8).\",\"sameAs\":[\"https:\/\/www.javacodegeeks.com\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/yatin-batra\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JDBC Connection Pool Example - Java Code Geeks","description":"In this article, we will try to show how does the JDBC connection pooling mechanism can be applied to a Java application.","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:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/","og_locale":"en_US","og_type":"article","og_title":"JDBC Connection Pool Example - Java Code Geeks","og_description":"In this article, we will try to show how does the JDBC connection pooling mechanism can be applied to a Java application.","og_url":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2017-07-28T08:00:51+00:00","article_modified_time":"2019-03-05T11:06:51+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","type":"image\/jpeg"}],"author":"Yatin","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Yatin","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/"},"author":{"name":"Yatin","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13"},"headline":"JDBC Connection Pool Example","datePublished":"2017-07-28T08:00:51+00:00","dateModified":"2019-03-05T11:06:51+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/"},"wordCount":1167,"commentCount":2,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","keywords":["core java","jdbc","poolableConnection"],"articleSection":["sql"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/","url":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/","name":"JDBC Connection Pool Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","datePublished":"2017-07-28T08:00:51+00:00","dateModified":"2019-03-05T11:06:51+00:00","description":"In this article, we will try to show how does the JDBC connection pooling mechanism can be applied to a Java application.","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","width":150,"height":150,"caption":"Bipartite Graph"},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/sql\/jdbc-connection-pool-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java Development","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/"},{"@type":"ListItem","position":3,"name":"Core Java","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/"},{"@type":"ListItem","position":4,"name":"sql","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/sql\/"},{"@type":"ListItem","position":5,"name":"JDBC Connection Pool Example"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13","name":"Yatin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg","caption":"Yatin"},"description":"An experience full-stack engineer well versed with Core Java, Spring\/Springboot, MVC, Security, AOP, Frontend (Angular &amp; React), and cloud technologies (such as AWS, GCP, Jenkins, Docker, K8).","sameAs":["https:\/\/www.javacodegeeks.com"],"url":"https:\/\/examples.javacodegeeks.com\/author\/yatin-batra\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/48784","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/119"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=48784"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/48784\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/1204"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=48784"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=48784"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=48784"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}