{"id":41650,"date":"2024-05-20T10:18:57","date_gmt":"2024-05-20T10:18:57","guid":{"rendered":"https:\/\/accuweb.cloud\/resource\/?post_type=faq&#038;p=41650"},"modified":"2026-02-19T05:23:20","modified_gmt":"2026-02-19T05:23:20","slug":"jdbc-connection-payara","status":"publish","type":"faq","link":"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara","title":{"rendered":"How To Perform Connection Pooling In JDBC With Payara Appllication Server?"},"content":{"rendered":"<h2 class=\"ack-h2\">How To Perform Connection Pooling In JDBC With Payara Application Server?<\/h2>\n<p>Java application servers like GlassFish and Payara use <strong>JDBC<\/strong> connection pooling to speed up and improve database access. This means they reuse database connections from a pool instead of creating new ones each time.<\/p>\n<p>Setting up a JDBC connection pool on your server can reduce delays and use fewer resources, which improves database performance, especially for dynamic applications.<\/p>\n<p>Here are simple steps to set up JDBC for Payara with <a class=\"ack-link-color\" href=\"https:\/\/accuweb.cloud\/\" target=\"_blank\" rel=\"noopener\">AccuWeb.Cloud.<\/a><\/p>\n<h2 class=\"ack-h2\">Create Environment<\/h2>\n<p><strong>Step 1.<\/strong> <a class=\"ack-link-color\" href=\"https:\/\/accuweb.cloud\/login\" target=\"_blank\" rel=\"noopener\">Log<\/a> into your AccuWeb.Cloud dashboard and click the <strong>&#8220;New environment&#8221;<\/strong> button.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-01.jpg\"><img fetchpriority=\"high\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41653 size-full\" title=\"New environment\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-01.jpg\" alt=\"New environment\" width=\"959\" height=\"247\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-01.jpg 959w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-01-300x77.jpg 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-01-768x198.jpg 768w\" sizes=\"(max-width: 959px) 100vw, 959px\" \/><\/a><\/p>\n<p><strong>Step 2.<\/strong> In the topology wizard, go to the <a class=\"ack-link-color\" href=\"https:\/\/accuweb.cloud\/application\/java-hosting\" target=\"_blank\" rel=\"noopener\">Java<\/a> tab, select Payara as your application server, and add the required database (e.g., <strong>MySQL<\/strong>). Set the resource limits for your containers and choose an environment name.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-02.jpg\"><img decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41665 size-full\" title=\" Java Application Server\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-02.jpg\" alt=\" Java Application Server\" width=\"975\" height=\"607\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-02.jpg 975w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-02-300x187.jpg 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-02-768x478.jpg 768w\" sizes=\"(max-width: 975px) 100vw, 975px\" \/><\/a><\/p>\n<p><strong>Step 3.<\/strong> Click <strong>&#8220;Create,&#8221;<\/strong> wait a few minutes for your new environment to be ready, and then proceed to create the <strong>JDBC connection pool.<\/strong><\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-02.jpg\"><img decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41665 size-full\" title=\"Connection Pool\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-02.jpg\" alt=\"\" width=\"975\" height=\"607\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-02.jpg 975w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-02-300x187.jpg 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-02-768x478.jpg 768w\" sizes=\"(max-width: 975px) 100vw, 975px\" \/><\/a><\/p>\n<h2 class=\"ack-h2\">Setting Up Database<\/h2>\n<p><strong>Step 1.<\/strong> Open your <strong>MySQL<\/strong> node in the browser by clicking the <strong>&#8220;Open in browser&#8221;<\/strong> button. Then, use the email you received with database credentials to log into the <strong>phpMyAdmin panel.<\/strong><\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-03.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41656 size-full\" title=\"Open in browse\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-03.jpg\" alt=\"Open in browse\" width=\"988\" height=\"500\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-03.jpg 988w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-03-300x152.jpg 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-03-768x389.jpg 768w\" sizes=\"(max-width: 988px) 100vw, 988px\" \/><\/a><\/p>\n<p><strong>Step 2.<\/strong> Once logged in, go to the User Accounts tab and click <strong>&#8220;Add user account&#8221;<\/strong>. Fill in all the necessary information in the form, and make sure to check the box that says <strong>&#8220;Create a database with the same name and grant all privileges&#8221;<\/strong>.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-01-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41657 size-full\" title=\"Create a Database\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-01-1.jpg\" alt=\"Create a Database\" width=\"1048\" height=\"625\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-01-1.jpg 1048w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-01-1-300x179.jpg 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-01-1-1024x611.jpg 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-01-1-768x458.jpg 768w\" sizes=\"(max-width: 1048px) 100vw, 1048px\" \/><\/a><\/p>\n<p>Finally, click <strong>&#8220;Go&#8221;<\/strong> at the bottom of the page to add the database and user for connection pooling.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-05.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41664 size-full\" title=\"Connection Pooling\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-05.jpg\" alt=\"Connection Pooling\" width=\"789\" height=\"409\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-05.jpg 789w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-05-300x156.jpg 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-05-768x398.jpg 768w\" sizes=\"(max-width: 789px) 100vw, 789px\" \/><\/a><\/p>\n<h2 class=\"ack-h2\">Setting Up Java Application Server<\/h2>\n<p><strong>Step 1.<\/strong> The JDBC MySQL connector is already included in the stack by default, so there&#8217;s no need to manually upload it. You can find it in the path <strong>\/opt\/payara\/glassfish\/domains\/domain1\/lib.<\/strong><\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-06.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41663 size-full\" title=\"Java Application Server\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-06.jpg\" alt=\"Java Application Server\" width=\"1045\" height=\"546\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-06.jpg 1045w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-06-300x157.jpg 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-06-1024x535.jpg 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-06-768x401.jpg 768w\" sizes=\"(max-width: 1045px) 100vw, 1045px\" \/><\/a><\/p>\n<p><strong>Step 2.<\/strong> Log in to the <strong>Payara Admin panel<\/strong> using the credentials provided in the email.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-07.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41655 size-full\" title=\"Admin panel Login\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-07.jpg\" alt=\"Admin panel Login\" width=\"1048\" height=\"583\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-07.jpg 1048w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-07-300x167.jpg 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-07-1024x570.jpg 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-07-768x427.jpg 768w\" sizes=\"(max-width: 1048px) 100vw, 1048px\" \/><\/a><\/p>\n<p><strong>Step 3.<\/strong> Navigate to <strong>Resources &gt; JDBC &gt; JDBC Connection Pools<\/strong> and click the New button.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-08.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41662 size-full\" title=\"JDBC Connection Pools\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-08.jpg\" alt=\"JDBC Connection Pools\" width=\"1051\" height=\"887\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-08.jpg 1051w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-08-300x253.jpg 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-08-1024x864.jpg 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-08-768x648.jpg 768w\" sizes=\"(max-width: 1051px) 100vw, 1051px\" \/><\/a><\/p>\n<h3 class=\"ack-h3\">In The Form That Appears, Fill In The Following Fields<\/h3>\n<ul class=\"ack-ul\">\n<li><strong>Pool Name:<\/strong> Choose any name you prefer.<\/li>\n<li><strong>Resource Type:<\/strong> Select javax.sql.DataSource.<\/li>\n<li><strong>Database Driver Vendor:<\/strong> Choose MySQL from the options.<\/li>\n<\/ul>\n<p>Click <strong>Next<\/strong> to continue.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-009.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41668 size-full\" title=\"New JDBC Connection Pool\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-009.webp\" alt=\"New JDBC Connection Pool\" width=\"1092\" height=\"670\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-009.webp 1092w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-009-300x184.webp 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-009-1024x628.webp 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-009-768x471.webp 768w\" sizes=\"(max-width: 1092px) 100vw, 1092px\" \/><\/a><\/p>\n<p><strong>Step 4.<\/strong> Modify the following Additional Properties:<\/p>\n<ul class=\"ack-ul\">\n<li><strong>User:<\/strong> Enter your database login (for pooling).<\/li>\n<li><strong>ServerName:<\/strong> Specify your database host without the protocol (e.g., node5211-connection-pooling.us-accuweb.cloud).<\/li>\n<li><strong>Port:<\/strong> Set the port number to 3306.<\/li>\n<li><strong>DatabaseName:<\/strong> Enter your database name (for pooling).<\/li>\n<li><strong>Password:<\/strong> Provide a password for the specified user.<\/li>\n<li><strong>URL or Url:<\/strong> Set the JDBC connection string in the jdbc:mysql:\/\/{db_host}:3306\/ format. Replace {db_host} with either the node hostname (node5211-connection-pooling.us-accuweb.cloud) or IP address (192.168.2.155).<\/li>\n<\/ul>\n<p>Once these properties are specified, click <strong>Finish.<\/strong><\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-010.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41669 size-full\" title=\"Additional Properties\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-010.png\" alt=\"Additional Properties\" width=\"1085\" height=\"599\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-010.png 1085w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-010-300x166.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-010-1024x565.png 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-010-768x424.png 768w\" sizes=\"(max-width: 1085px) 100vw, 1085px\" \/><\/a><\/p>\n<p>Once you click on the finish button, the new pool will be added and shown in the Pools section.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-011.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41670 size-full\" title=\"Pools Section\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-011.png\" alt=\"Pools Section\" width=\"1103\" height=\"517\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-011.png 1103w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-011-300x141.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-011-1024x480.png 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-011-768x360.png 768w\" sizes=\"(max-width: 1103px) 100vw, 1103px\" \/><\/a><\/p>\n<p><strong>Step 5.<\/strong> To verify accessibility, select the newly created connection pool and click the <strong>Ping<\/strong> button. You should see a <strong>&#8220;Ping Succeeded&#8221;<\/strong> message if everything is working correctly.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-012.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41671 size-full\" title=\"Created Connection Pool\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-012.jpg\" alt=\"Created Connection Pool\" width=\"1093\" height=\"828\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-012.jpg 1093w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-012-300x227.jpg 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-012-1024x776.jpg 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/java-aplication-012-768x582.jpg 768w\" sizes=\"(max-width: 1093px) 100vw, 1093px\" \/><\/a><\/p>\n<p><strong>Step 6.<\/strong> Navigate to <strong>Resources &gt; JDBC &gt; JDBC<\/strong> Resources and click the New button to create JDBC resources for pooling.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-09.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41661 size-full\" title=\"JDBC Resources For Pooling\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-09.jpg\" alt=\"JDBC Resources For Pooling\" width=\"1132\" height=\"796\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-09.jpg 1132w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-09-300x211.jpg 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-09-1024x720.jpg 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-09-768x540.jpg 768w\" sizes=\"(max-width: 1132px) 100vw, 1132px\" \/><\/a><\/p>\n<p><strong>Step 7.<\/strong> In the window that appears, provide a desired JNDI Name and choose your Pool Name from the drop-down list. Confirm the creation of resources by clicking <strong>OK<\/strong> at the top.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-10.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41660 size-full\" title=\"Creation of Resources\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-10.jpg\" alt=\"Creation of Resources\" width=\"881\" height=\"591\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-10.jpg 881w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-10-300x201.jpg 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-10-768x515.jpg 768w\" sizes=\"(max-width: 881px) 100vw, 881px\" \/><\/a><\/p>\n<p><strong>Step 8.<\/strong> Once you click on the OK button, the new resource will be added and displayed in the Resources section.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-11.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41659 size-full\" title=\"Resources Section\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-11.jpg\" alt=\"Resources Section\" width=\"875\" height=\"514\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-11.jpg 875w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-11-300x176.jpg 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-11-768x451.jpg 768w\" sizes=\"(max-width: 875px) 100vw, 875px\" \/><\/a><\/p>\n<h2 class=\"ack-h2\">Connecting from Java Code<\/h2>\n<p>Insert the following lines into your application&#8217;s Java class:<\/p>\n<ul class=\"ack-ul\">\n<li><strong>InitialContext ctx = new InitialContext();<\/strong><\/li>\n<li><strong>DataSource ds = (DataSource)ctx.lookup(&#8220;{resources}&#8221;);<\/strong><\/li>\n<li><strong>Connection conn = ds.getConnection();<\/strong><\/li>\n<\/ul>\n<p>Replace the <strong>{resources}<\/strong> placeholder with your JNDI name from the previous section (e.g., jdbc\/mypool in our case).<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-12.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41658 size-full\" title=\"Connecting from Java\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-12.jpg\" alt=\"Connecting from Java\" width=\"1096\" height=\"840\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-12.jpg 1096w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-12-300x230.jpg 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-12-1024x785.jpg 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/Java-application-servers-12-768x589.jpg 768w\" sizes=\"(max-width: 1096px) 100vw, 1096px\" \/><\/a><\/p>\n<p>Now, you can deploy your Java application to the AccuWeb.Cloud environment you created and take advantage of Payara connection pooling!<\/p>\n<h2 class=\"ack-h2\">Conclusion<\/h2>\n<p>In conclusion, connecting a Payara app to <strong>MySQL<\/strong> is essential for database operations. Configuring JDBC drivers and connection details establishes smooth communication between your Payara app and the database.<\/p>\n<p>Setting up a <strong>JDBC<\/strong> connection pool on your server can reduce delays and save resources, which improves database performance, especially for dynamic applications.<\/p>\n<div class=\"cta-btn-top-space\"><\/div>\n\t\t<div data-elementor-type=\"section\" data-elementor-id=\"38668\" class=\"elementor elementor-38668\" data-elementor-settings=\"{&quot;ha_cmc_init_switcher&quot;:&quot;no&quot;}\" data-elementor-post-type=\"elementor_library\">\n\t\t\t        <section class=\"elementor-section elementor-top-section elementor-element elementor-element-882321f elementor-section-boxed elementor-section-height-default elementor-section-height-default ct-header-fixed-none ct-row-max-none\" data-id=\"882321f\" data-element_type=\"section\" data-settings=\"{&quot;_ha_eqh_enable&quot;:false}\">\n            \n                        <div class=\"elementor-container elementor-column-gap-default \">\n                    <div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7cc79cc\" data-id=\"7cc79cc\" data-element_type=\"column\">\n        <div class=\"elementor-widget-wrap elementor-element-populated\">\n                    \n        \t\t<div class=\"elementor-element elementor-element-e31b40f elementor-widget elementor-widget-shortcode\" data-id=\"e31b40f\" data-element_type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-shortcode\"><\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t            <\/div>\n        <\/div>\n                    <\/div>\n        <\/section>\n        \t\t<\/div>\n\t\t\n<div class=\"cta-btn-bottom-space\"><\/div>\n","protected":false},"author":1,"featured_media":52879,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","class_list":["post-41650","faq","type-faq","status-publish","has-post-thumbnail","hentry","faq_topics-database-hosting","faq_topics-databases","faq_topics-jdbc-width-payara","faq_topics-kb","faq_topics-product-documentation"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.10 (Yoast SEO v24.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Setup JDBC connection pooling with AccuWeb.Cloud guide<\/title>\n<meta name=\"description\" content=\"Discover how to optimize your database performance with our step-by-step guide to setting up JDBC connection pooling on AccuWeb.cloud.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Perform Connection Pooling In JDBC With Payara Appllication Server?\" \/>\n<meta property=\"og:description\" content=\"Discover how to optimize your database performance with our step-by-step guide to setting up JDBC connection pooling on AccuWeb.cloud.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara\" \/>\n<meta property=\"og:site_name\" content=\"AccuWeb Cloud\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-19T05:23:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara#article\",\"isPartOf\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara\"},\"author\":{\"name\":\"Jilesh Patadiya\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/#\/schema\/person\/a7a4cbe8405202b537509c757b588c58\"},\"headline\":\"How To Perform Connection Pooling In JDBC With Payara Appllication Server?\",\"datePublished\":\"2024-05-20T10:18:57+00:00\",\"dateModified\":\"2026-02-19T05:23:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara\"},\"wordCount\":692,\"publisher\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/#organization\"},\"image\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara#primaryimage\"},\"thumbnailUrl\":\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg\",\"inLanguage\":\"en-US\"},{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara\",\"url\":\"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara\",\"name\":\"Setup JDBC connection pooling with AccuWeb.Cloud guide\",\"isPartOf\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara#primaryimage\"},\"image\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara#primaryimage\"},\"thumbnailUrl\":\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg\",\"datePublished\":\"2024-05-20T10:18:57+00:00\",\"dateModified\":\"2026-02-19T05:23:20+00:00\",\"description\":\"Discover how to optimize your database performance with our step-by-step guide to setting up JDBC connection pooling on AccuWeb.cloud.\",\"breadcrumb\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara#primaryimage\",\"url\":\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg\",\"contentUrl\":\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/accuweb.cloud\/resource\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Perform Connection Pooling In JDBC With Payara Appllication Server?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/#website\",\"url\":\"https:\/\/accuweb.cloud\/resource\/\",\"name\":\"AccuWeb Cloud\",\"description\":\"Cutting Edge Cloud Computing\",\"publisher\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/accuweb.cloud\/resource\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/#organization\",\"name\":\"AccuWeb.Cloud\",\"url\":\"https:\/\/accuweb.cloud\/resource\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/04\/accuwebcloud_logo_black_tagline.jpg\",\"contentUrl\":\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/04\/accuwebcloud_logo_black_tagline.jpg\",\"width\":156,\"height\":87,\"caption\":\"AccuWeb.Cloud\"},\"image\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/#\/schema\/person\/a7a4cbe8405202b537509c757b588c58\",\"name\":\"Jilesh Patadiya\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2cea2bdb5bbabb771ee67e96acad7396f25cb1a0c360b9bc4a9ac40cea9cd8b2?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2cea2bdb5bbabb771ee67e96acad7396f25cb1a0c360b9bc4a9ac40cea9cd8b2?s=96&d=mm&r=g\",\"caption\":\"Jilesh Patadiya\"},\"description\":\"Jilesh Patadiya, the visionary Co-Founder and Chief Technology Officer (CTO) behind AccuWeb.Cloud. Founder &amp; CTO at AccuWebHosting.com. He shares his web hosting insights on the AccuWeb.Cloud blog. He mostly writes on the latest web hosting trends, WordPress, storage technologies, and Windows and Linux hosting platforms.\",\"sameAs\":[\"https:\/\/accuweb.cloud\/resource\",\"https:\/\/www.facebook.com\/accuwebhosting\",\"https:\/\/www.instagram.com\/accuwebhosting\/\",\"https:\/\/www.linkedin.com\/company\/accuwebhosting\/\",\"https:\/\/x.com\/accuwebhosting\",\"https:\/\/www.youtube.com\/c\/Accuwebhosting\"],\"url\":\"https:\/\/accuweb.cloud\/resource\/author\/accuwebadmin\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Setup JDBC connection pooling with AccuWeb.Cloud guide","description":"Discover how to optimize your database performance with our step-by-step guide to setting up JDBC connection pooling on AccuWeb.cloud.","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:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara","og_locale":"en_US","og_type":"article","og_title":"How To Perform Connection Pooling In JDBC With Payara Appllication Server?","og_description":"Discover how to optimize your database performance with our step-by-step guide to setting up JDBC connection pooling on AccuWeb.cloud.","og_url":"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara","og_site_name":"AccuWeb Cloud","article_modified_time":"2026-02-19T05:23:20+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara#article","isPartOf":{"@id":"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara"},"author":{"name":"Jilesh Patadiya","@id":"https:\/\/accuweb.cloud\/resource\/#\/schema\/person\/a7a4cbe8405202b537509c757b588c58"},"headline":"How To Perform Connection Pooling In JDBC With Payara Appllication Server?","datePublished":"2024-05-20T10:18:57+00:00","dateModified":"2026-02-19T05:23:20+00:00","mainEntityOfPage":{"@id":"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara"},"wordCount":692,"publisher":{"@id":"https:\/\/accuweb.cloud\/resource\/#organization"},"image":{"@id":"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara#primaryimage"},"thumbnailUrl":"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg","inLanguage":"en-US"},{"@type":["WebPage","FAQPage"],"@id":"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara","url":"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara","name":"Setup JDBC connection pooling with AccuWeb.Cloud guide","isPartOf":{"@id":"https:\/\/accuweb.cloud\/resource\/#website"},"primaryImageOfPage":{"@id":"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara#primaryimage"},"image":{"@id":"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara#primaryimage"},"thumbnailUrl":"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg","datePublished":"2024-05-20T10:18:57+00:00","dateModified":"2026-02-19T05:23:20+00:00","description":"Discover how to optimize your database performance with our step-by-step guide to setting up JDBC connection pooling on AccuWeb.cloud.","breadcrumb":{"@id":"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara#primaryimage","url":"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg","contentUrl":"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/accuweb.cloud\/resource\/articles\/jdbc-connection-payara#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/accuweb.cloud\/resource\/"},{"@type":"ListItem","position":2,"name":"How To Perform Connection Pooling In JDBC With Payara Appllication Server?"}]},{"@type":"WebSite","@id":"https:\/\/accuweb.cloud\/resource\/#website","url":"https:\/\/accuweb.cloud\/resource\/","name":"AccuWeb Cloud","description":"Cutting Edge Cloud Computing","publisher":{"@id":"https:\/\/accuweb.cloud\/resource\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/accuweb.cloud\/resource\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/accuweb.cloud\/resource\/#organization","name":"AccuWeb.Cloud","url":"https:\/\/accuweb.cloud\/resource\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/accuweb.cloud\/resource\/#\/schema\/logo\/image\/","url":"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/04\/accuwebcloud_logo_black_tagline.jpg","contentUrl":"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/04\/accuwebcloud_logo_black_tagline.jpg","width":156,"height":87,"caption":"AccuWeb.Cloud"},"image":{"@id":"https:\/\/accuweb.cloud\/resource\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/accuweb.cloud\/resource\/#\/schema\/person\/a7a4cbe8405202b537509c757b588c58","name":"Jilesh Patadiya","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/accuweb.cloud\/resource\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2cea2bdb5bbabb771ee67e96acad7396f25cb1a0c360b9bc4a9ac40cea9cd8b2?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2cea2bdb5bbabb771ee67e96acad7396f25cb1a0c360b9bc4a9ac40cea9cd8b2?s=96&d=mm&r=g","caption":"Jilesh Patadiya"},"description":"Jilesh Patadiya, the visionary Co-Founder and Chief Technology Officer (CTO) behind AccuWeb.Cloud. Founder &amp; CTO at AccuWebHosting.com. He shares his web hosting insights on the AccuWeb.Cloud blog. He mostly writes on the latest web hosting trends, WordPress, storage technologies, and Windows and Linux hosting platforms.","sameAs":["https:\/\/accuweb.cloud\/resource","https:\/\/www.facebook.com\/accuwebhosting","https:\/\/www.instagram.com\/accuwebhosting\/","https:\/\/www.linkedin.com\/company\/accuwebhosting\/","https:\/\/x.com\/accuwebhosting","https:\/\/www.youtube.com\/c\/Accuwebhosting"],"url":"https:\/\/accuweb.cloud\/resource\/author\/accuwebadmin"}]}},"_links":{"self":[{"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/faq\/41650","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/faq"}],"about":[{"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/types\/faq"}],"author":[{"embeddable":true,"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/comments?post=41650"}],"version-history":[{"count":11,"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/faq\/41650\/revisions"}],"predecessor-version":[{"id":53240,"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/faq\/41650\/revisions\/53240"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/media\/52879"}],"wp:attachment":[{"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/media?parent=41650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}