{"id":3285,"date":"2020-04-30T19:09:46","date_gmt":"2020-04-30T19:39:46","guid":{"rendered":"https:\/\/ultering.com\/it4us\/?p=3285"},"modified":"2020-08-30T15:57:06","modified_gmt":"2020-08-30T16:27:06","slug":"wildfly-postgresql-and-mysql-jboss-datasource-configuration","status":"publish","type":"post","link":"https:\/\/ultering.com\/it4us\/?p=3285","title":{"rendered":"WILDFLY\/JBOSS: POSTGRESQL AND MYSQL DATASOURCE CONFIGURATION"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_73 counter-hierarchy ez-toc-counter ez-toc-white ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69f28305dce9c\" class=\"ez-toc-cssicon-toggle-label\"><span class><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\" \/><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\" \/><\/svg><\/span><\/span><\/label><input type=\"checkbox\" id=\"ez-toc-cssicon-toggle-item-69f28305dce9c\" checked aria-label=\"Toggle\"><nav><ul class=\"ez-toc-list ez-toc-list-level-1 \"><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ultering.com\/it4us\/?p=3285\/#ENVIRONMENT\" title=\"ENVIRONMENT\">ENVIRONMENT<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ultering.com\/it4us\/?p=3285\/#DRIVER_CONFIGURATION\" title=\"DRIVER CONFIGURATION\">DRIVER CONFIGURATION<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ultering.com\/it4us\/?p=3285\/#DRIVER_DOWNLOAD\" title=\"DRIVER DOWNLOAD\">DRIVER DOWNLOAD<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ultering.com\/it4us\/?p=3285\/#INSTALLING_THE_DRIVER_ON_THE_WILDFLY_SERVER_JBOSS\" title=\"INSTALLING THE DRIVER ON THE WILDFLY SERVER (JBOSS)\">INSTALLING THE DRIVER ON THE WILDFLY SERVER (JBOSS)<\/a><ul class=\"ez-toc-list-level-4\"><li class=\"ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ultering.com\/it4us\/?p=3285\/#A_SYSTEMATIC_WAY_OF_DOING_THIS\" title=\"A SYSTEMATIC WAY OF DOING THIS\">A SYSTEMATIC WAY OF DOING THIS<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ultering.com\/it4us\/?p=3285\/#INSTALLING_THE_DRIVE\" title=\"INSTALLING THE DRIVE\">INSTALLING THE DRIVE<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ultering.com\/it4us\/?p=3285\/#REGISTERING_THE_DRIVER\" title=\"REGISTERING THE DRIVER\">REGISTERING THE DRIVER<\/a><ul class=\"ez-toc-list-level-4\"><li class=\"ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ultering.com\/it4us\/?p=3285\/#Where_Follow_the_picture\" title=\"Where? \nFollow the picture.\">Where? \nFollow the picture.<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/ultering.com\/it4us\/?p=3285\/#Discover_the_%E2%80%9C%E2%80%9D_for_your_driver\" title=\"Discover the &#8220;&lt;driver-class&gt;&#8221; for your driver.\">Discover the &#8220;&lt;driver-class&gt;&#8221; for your driver.<\/a><ul class=\"ez-toc-list-level-5\"><li class=\"ez-toc-heading-level-5\"><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/ultering.com\/it4us\/?p=3285\/#Turn_the_subpath_to_the_respective_driver_name\" title=\"Turn the subpath to the respective driver name\">Turn the subpath to the respective driver name<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/ultering.com\/it4us\/?p=3285\/#TESTING_THE_DRIVER_CONFIGURATION\" title=\"TESTING THE DRIVER CONFIGURATION\">TESTING THE DRIVER CONFIGURATION<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/ultering.com\/it4us\/?p=3285\/#CONFIGURING_THE_DATABASES_DATASOURCE\" title=\"CONFIGURING THE DATABASE&#8217;S DATASOURCE\">CONFIGURING THE DATABASE&#8217;S DATASOURCE<\/a><ul class=\"ez-toc-list-level-5\"><li class=\"ez-toc-heading-level-5\"><ul class=\"ez-toc-list-level-5\"><li class=\"ez-toc-heading-level-5\"><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/ultering.com\/it4us\/?p=3285\/#Where_to_insert_it\" title=\"Where to insert it?\">Where to insert it?<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"ENVIRONMENT\"><\/span>ENVIRONMENT<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Java 13<br>\nWildfly 18<br>\nWindows 10 \/ *Nix&nbsp; (also applicable adapting the commands)<\/p>\n<h2><span class=\"ez-toc-section\" id=\"DRIVER_CONFIGURATION\"><\/span>DRIVER CONFIGURATION<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><strong><br>\nThe trick is to match the requirements of the participants.<\/strong><\/p>\n<p>They are:<br>\n&#8211; the application server&#8217;s (the way it requires the configuration)<br>\n&#8211; the target database version (type of database and version)<br>\n&#8211; the driver compatible with the target database (type and version)<\/p>\n<p>Usually the unsuccessful configuration comes from that one or more of the requirements are not correct.<br>\nSo, it is necessary to follow a method, step by step, in order to be able to identify each requirement by its turn to get the configuration done faster.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"DRIVER_DOWNLOAD\"><\/span>DRIVER DOWNLOAD<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>MySQL<br>\n<a href=\"https:\/\/dev.mysql.com\/downloads\/connector\/j\/5.1.html\">dev.mysql.com\/downloads\/connector\/j\/5.1.html<\/a><\/p>\n<p>PostgreSQL<br>\n<a href=\"https:\/\/jdbc.postgresql.org\/download.html\">jdbc.postgresql.org\/download.html<\/a><\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"INSTALLING_THE_DRIVER_ON_THE_WILDFLY_SERVER_JBOSS\"><\/span>INSTALLING THE DRIVER ON THE WILDFLY SERVER (JBOSS)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h4><span class=\"ez-toc-section\" id=\"A_SYSTEMATIC_WAY_OF_DOING_THIS\"><\/span>A SYSTEMATIC WAY OF DOING THIS<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Here comes the first guess \u2014 how to choose it?<\/p>\n<p>Considering that the driver is a connector from the application to the database, it is necessary to consider first the application&#8217;s version.<br>\nNewer libraries, newer drivers.<br>\nThe last point is to check if the driver although compatible with the application it is also compatible with the target database \u2014 the one to be used by the application.<\/p>\n<p>The first guess is an attempt.<br>\nIf it fails, it is necessary to try another version still compatible with the application and the database.<br>\nI begin by the latest driver&#8217;s version for the target application and if it fails, I get the next older driver next to the date of the application&#8217;s libraries.<br>\nUsing an approach top-down you may have the chance to get the latest compatible choice compatible with the target environment.<\/p>\n<p>NOTE: sometimes, when the configuration tests passes, the application may fail for some feature.<br>\nIn this case, it necessary to reconfigure to another driver older, but compatible with one of the libraries that it is causing the malfunction.<\/p>\n<p>Configuration is all about putting compatible codes to work together.<br>\nSo, in general, always consider the date that such codes were created and their compatibilities.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"INSTALLING_THE_DRIVE\"><\/span>INSTALLING THE DRIVE<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p><strong>#1<\/strong><br>\nPrepare your command that it is gonna be used on server&#8217;s console to register the driver:<br>\nmodule add &#8211;name=com.mysql.driver &#8211;dependencies=javax.api,javax.transaction.api &#8211;resources=\/PATH\/TO\/DRIVER.JAR<br>\nEx.:<br>\n<em>&#8211; MySQL:<\/em><br>\nmodule add &#8211;name=com.mysql.driver &#8211;dependencies=javax.api,javax.transaction.api &#8211;resources=L:\\transp\\1___downloads\\mysql-connector-java-5.1.49\\mysql-connector-java-5.1.49-bin.jar<br>\n<em>&#8211; PostgreSQL:<\/em><br>\nmodule add &#8211;name=com.postgres.driver &#8211;dependencies=javax.api,javax.transaction.api &#8211;resources=L:\\transp\\1___downloads\\postgresql-42.2.12.jar<\/p>\n<p><strong>#2<\/strong><br>\nStart jboss and go to $SERVER_INSTALL_DIR\\bin..<\/p>\n<p><strong>#3<\/strong><br>\nRun:jboss-cli.bat<br>\nor if *nix: jboss-cli.sh<\/p>\n<p>It returns the prompt:<br>\n[standalone@localhost:9990 \/]\n<\/p><p><strong>#4<\/strong><br>\nRun the command prepared above. Using the PostgreSQL cmd:<br>\nmodule add &#8211;name=com.postgres.driver &#8211;dependencies=javax.api,javax.transaction.api &#8211;resources=L:\\transp\\1___downloads\\postgresql-42.2.12.jar<\/p>\n<p>The commandwill create the driver content under<br>\n$SERVER_INSTALL_DIR\\modules\\postgres\\driver\\main.Check the figure.<\/p>\n<p>&nbsp;<\/p>\n<p><noscript><img decoding=\"async\" src=\"https:\/\/ultering.com\/it4us\/wp-content\/uploads\/2020\/04\/wildfly_datasource_connection_configuration_postgresql_00.jpg\" alt width=\"255\" height=\"497\"><\/noscript><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20255%20497%22%3E%3C%2Fsvg%3E\" alt width=\"255\" height=\"497\" data-src=\"https:\/\/ultering.com\/it4us\/wp-content\/uploads\/2020\/04\/wildfly_datasource_connection_configuration_postgresql_00.jpg\" class=\" lazyload\"><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>The PostgreSQL procedure copies the jar file and creates the module.xml file at:<br>\n$SERVER_INSTALL_DIR\\\\com\\postgres\\driver\\main<\/p>\n<pre class>&lt;?xml version='1.0' encoding='UTF-8'?&gt;\n\n&lt;module xmlns=\"urn:jboss:module:1.1\" name=\"com.postgres.driver\"&gt;\n\n    &lt;resources&gt;\n        &lt;resource-root path=\"postgresql-42.2.12.jar\"\/&gt;\n    &lt;\/resources&gt;\n\n    &lt;dependencies&gt;\n        &lt;module name=\"javax.api\"\/&gt;\n        &lt;module name=\"javax.transaction.api\"\/&gt;\n    &lt;\/dependencies&gt;\n&lt;\/module&gt;\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>#5<br>\n<\/strong>Do the same for MySQL.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"REGISTERING_THE_DRIVER\"><\/span>REGISTERING THE DRIVER<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><strong>#1<\/strong><br>\nEdit the standalone.xml file supposing this is the one used by your server.<br>\nSometimes it is used another, for instance the full version.<br>\nCheck your configuration.$SERVER_INSTALL_DIR\\standalone\\configuration\\standalone.xml..<\/p>\n<p><strong>#2<\/strong><br>\nAdd the snippet below used as example, adapting to your need.<br>\nIMPORTANT: check below how to discover the &#8220;&lt;driver-class&gt;&#8221; for your driver.<\/p>\n<pre class>&lt;driver name=\"mysql\" module=\"com.mysql.driver\"&gt;\n\t &lt;driver-class&gt;org.gjt.mm.mysql.Driver&lt;\/driver-class&gt;\n&lt;\/driver&gt;\t\t\t\t\t\n&lt;driver name=\"postgres\" module=\"com.postgres.driver\"&gt;\n\t &lt;driver-class&gt;org.postgresql.Driver&lt;\/driver-class&gt;\n&lt;\/driver&gt;\t\t\t\t\t\n<\/pre>\n<p>&nbsp;<\/p>\n<h4><strong>Where?<br>\n<\/strong>Follow the picture.<\/h4>\n<p><noscript><img decoding=\"async\" class=\"alignnone size-full wp-image-3292\" src=\"https:\/\/ultering.com\/it4us\/wp-content\/uploads\/2020\/04\/wildfly_datasource_connection_configuration_postgresql_01-1.jpg\" alt width=\"670\" height=\"275\" srcset=\"https:\/\/ultering.com\/it4us\/wp-content\/uploads\/2020\/04\/wildfly_datasource_connection_configuration_postgresql_01-1.jpg 670w, https:\/\/ultering.com\/it4us\/wp-content\/uploads\/2020\/04\/wildfly_datasource_connection_configuration_postgresql_01-1-300x123.jpg 300w\" sizes=\"(max-width: 670px) 100vw, 670px\"><\/noscript><img decoding=\"async\" class=\"alignnone size-full wp-image-3292 lazyload\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20670%20275%22%3E%3C%2Fsvg%3E\" alt width=\"670\" height=\"275\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20670%20275%22%3E%3C%2Fsvg%3E 670w\" sizes=\"(max-width: 670px) 100vw, 670px\" data-srcset=\"https:\/\/ultering.com\/it4us\/wp-content\/uploads\/2020\/04\/wildfly_datasource_connection_configuration_postgresql_01-1.jpg 670w, https:\/\/ultering.com\/it4us\/wp-content\/uploads\/2020\/04\/wildfly_datasource_connection_configuration_postgresql_01-1-300x123.jpg 300w\" data-src=\"https:\/\/ultering.com\/it4us\/wp-content\/uploads\/2020\/04\/wildfly_datasource_connection_configuration_postgresql_01-1.jpg\"><\/p>\n<p>&nbsp;<\/p>\n<p>IMPORTANT:<br>\nMake sure that you insert in the right place.<br>\nUse for you module name the same used in your command.<br>\nIn this example was:<br>\nmodule add <strong>&#8211;name=com.postgres.driver<\/strong> &#8230;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h4><span class=\"ez-toc-section\" id=\"Discover_the_%E2%80%9C%E2%80%9D_for_your_driver\"><\/span>Discover the &#8220;&lt;driver-class&gt;&#8221; for your driver.<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>For instance, suppose the following example using mysql-connector-java-5.1.49.jar.<br>\nCopy and rename it to a temporary file as a zip file:<\/p>\n<p><em>mysql-connector-java-5.1.49.jar.zip<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>Extract its content and to find where the Driver.class is.<\/p>\n<p>In this example we found it under:<\/p>\n<p><em>postgresql-42.2.12.jar\\org\\postgresql\\Driver.class<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><strong>For MySQL<\/strong>, was done the same and found at:<\/p>\n<p><em>mysql-connector-java-5.1.49-bin.jar\\org\\gjt\\mm\\mysql\\Driver.class<\/em><\/p>\n<p>&nbsp;<\/p>\n<h5><span class=\"ez-toc-section\" id=\"Turn_the_subpath_to_the_respective_driver_name\"><\/span>Turn the subpath to the respective driver name<span class=\"ez-toc-section-end\"><\/span><\/h5>\n<p><strong><br>\nFor PostgreSQL:<\/strong><br>\norg\\postgresql\\Driver.class ==&gt; org.postgresql.Driver<\/p>\n<p>That becomes the driver-class in the driver element:<br>\n&lt;driver-class&gt;org.postgresql.Driver&lt;\/driver-class&gt;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>For MySQL:<\/strong><br>\norg\\gjt\\mm\\mysql\\Driver.class ==&gt; org.gjt.mm.mysql.Driver<\/p>\n<p>That becomes the driver-class in the driver element:<br>\n&lt;driver-class&gt;org.gjt.mm.mysql.Driver&lt;\/driver-class&gt;<\/p>\n<p>&nbsp;<\/p>\n<h4><span class=\"ez-toc-section\" id=\"TESTING_THE_DRIVER_CONFIGURATION\"><\/span>TESTING THE DRIVER CONFIGURATION<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Start Wildfly (JBoss) and check its output on console.<br>\nIf it returns clean, without any error, it is time to go to the next step, otherwise revise the steps above.<\/p>\n<p>Below, there is an example of the server&#8217;s output with a configuration failure:<\/p>\n<p>&nbsp;<\/p>\n<div class=\"outputlisting2\">13:59:07,748 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation (&#8220;add&#8221;) failed &#8211; address: ([<br>\n(&#8220;subsystem&#8221; =&gt; &#8220;datasources&#8221;),<br>\n(&#8220;data-source&#8221; =&gt; &#8220;pgTestoneDS&#8221;)<br>\n]) &#8211; failure description: {<br>\n&#8220;WFLYCTL0412: Required services that are not installed:&#8221; =&gt; [&#8220;jboss.jdbc-driver.postgresql&#8221;],<br>\n&#8220;WFLYCTL0180: Services with missing\/unavailable dependencies&#8221; =&gt; [<br>\n&#8220;org.wildfly.data-source.pgTestoneDS is missing [jboss.jdbc-driver.postgresql]&#8221;,<br>\n&#8220;jboss.driver-demander.java:jboss\/datasources\/pgTestoneDS is missing [jboss.jdbc-driver.postgresql]&#8221;<br>\n]\n}<br>\n13:59:07,758 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation (&#8220;add&#8221;) failed &#8211; address: ([<br>\n(&#8220;subsystem&#8221; =&gt; &#8220;datasources&#8221;),<br>\n(&#8220;data-source&#8221; =&gt; &#8220;pgTestoneDS&#8221;)<br>\n]) &#8211; failure description: {<br>\n&#8220;WFLYCTL0412: Required services that are not installed:&#8221; =&gt; [<br>\n&#8220;jboss.jdbc-driver.postgresql&#8221;,<br>\n&#8220;jboss.jdbc-driver.postgresql&#8221;<br>\n],<br>\n&#8220;WFLYCTL0180: Services with missing\/unavailable dependencies&#8221; =&gt; [<br>\n&#8220;org.wildfly.data-source.pgTestoneDS is missing [jboss.jdbc-driver.postgresql]&#8221;,<br>\n&#8220;jboss.driver-demander.java:jboss\/datasources\/pgTestoneDS is missing [jboss.jdbc-driver.postgresql]&#8221;,<br>\n&#8220;org.wildfly.data-source.pgTestoneDS is missing [jboss.jdbc-driver.postgresql]&#8221;<br>\n]\n}<\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"CONFIGURING_THE_DATABASES_DATASOURCE\"><\/span>CONFIGURING THE DATABASE&#8217;S DATASOURCE<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Now, the last step \u2014 datasource registering.<\/p>\n<p>The example below is shown as a template that you may adapt to your need.<\/p>\n<p><strong><br>\nFor PostgreSQL:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<pre class>&lt;datasource jta=\"true\" jndi-name=\"java:jboss\/datasources\/pgTestoneDS\" pool-name=\"pgTestoneDS\" enabled=\"true\" use-java-context=\"true\" use-ccm=\"true\"&gt;\n\t&lt;connection-url&gt;jdbc:postgresql:\/\/localhost:5432\/testone&lt;\/connection-url&gt;\n\t&lt;driver&gt;postgres&lt;\/driver&gt;\n\t&lt;transaction-isolation&gt;TRANSACTION_READ_COMMITTED&lt;\/transaction-isolation&gt;\n\t&lt;pool&gt;\n\t\t&lt;min-pool-size&gt;10&lt;\/min-pool-size&gt;\n\t\t&lt;max-pool-size&gt;100&lt;\/max-pool-size&gt;\n\t\t&lt;prefill&gt;true&lt;\/prefill&gt;\n\t&lt;\/pool&gt;\n\t&lt;security&gt;\n\t\t&lt;user-name&gt;postgres&lt;\/user-name&gt;\n\t\t&lt;password&gt;postgres&lt;\/password&gt;\n\t&lt;\/security&gt;\n\t&lt;statement&gt;\n\t\t&lt;prepared-statement-cache-size&gt;32&lt;\/prepared-statement-cache-size&gt;\n\t\t&lt;share-prepared-statements&gt;true&lt;\/share-prepared-statements&gt;\n\t&lt;\/statement&gt;\n&lt;\/datasource&gt;\n\n<\/pre>\n<p><strong>For MySQL:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<pre class>&lt;datasource jta=\"true\" jndi-name=\"java:jboss\/datasources\/mysqlTestoneDS\" pool-name=\"mysqlTestoneDS\" enabled=\"true\" use-java-context=\"true\" use-ccm=\"true\"&gt;\n\t&lt;connection-url&gt;jdbc:mysql:\/\/localhost:3306\/testone&lt;\/connection-url&gt;\n\t&lt;driver&gt;mysql&lt;\/driver&gt;\n\t&lt;transaction-isolation&gt;TRANSACTION_READ_COMMITTED&lt;\/transaction-isolation&gt;\n\t&lt;pool&gt;\n\t\t&lt;min-pool-size&gt;10&lt;\/min-pool-size&gt;\n\t\t&lt;max-pool-size&gt;100&lt;\/max-pool-size&gt;\n\t\t&lt;prefill&gt;true&lt;\/prefill&gt;\n\t&lt;\/pool&gt;\n\t&lt;security&gt;\n\t\t&lt;user-name&gt;root&lt;\/user-name&gt;\n\t\t&lt;password&gt;root&lt;\/password&gt;\n\t&lt;\/security&gt;\n\t&lt;statement&gt;\n\t\t&lt;prepared-statement-cache-size&gt;32&lt;\/prepared-statement-cache-size&gt;\n\t\t&lt;share-prepared-statements&gt;true&lt;\/share-prepared-statements&gt;\n\t&lt;\/statement&gt;\n&lt;\/datasource&gt;\n\n<\/pre>\n<h5><\/h5>\n<h5><\/h5>\n<h5><span class=\"ez-toc-section\" id=\"Where_to_insert_it\"><\/span>Where to insert it?<span class=\"ez-toc-section-end\"><\/span><\/h5>\n<p>After the last &lt;datasource&gt; and before the &lt;drivers&gt; element.<br>\nFollow the picture.<\/p>\n<p><strong><br>\nIMPORTANT:<br>\n<\/strong><\/p>\n<p>The datasource&#8217;s driver element:<br>\n&lt;driver&gt;postgres&lt;driver&gt;<\/p>\n<p>must match the drive&#8217;s name:<br>\n&lt;<strong>driver name=&#8221;postgres&#8221;<\/strong> module=&#8221;com.postgres.driver&#8221;&gt;<\/p>\n<p>&nbsp;<\/p>\n<p><noscript><img decoding=\"async\" class=\"alignnone size-full wp-image-3297\" src=\"https:\/\/ultering.com\/it4us\/wp-content\/uploads\/2020\/04\/wildfly_datasource_connection_configuration_postgresql_mysql_03-1.jpg\" alt width=\"1305\" height=\"649\" srcset=\"https:\/\/ultering.com\/it4us\/wp-content\/uploads\/2020\/04\/wildfly_datasource_connection_configuration_postgresql_mysql_03-1.jpg 1305w, https:\/\/ultering.com\/it4us\/wp-content\/uploads\/2020\/04\/wildfly_datasource_connection_configuration_postgresql_mysql_03-1-300x149.jpg 300w, https:\/\/ultering.com\/it4us\/wp-content\/uploads\/2020\/04\/wildfly_datasource_connection_configuration_postgresql_mysql_03-1-768x382.jpg 768w\" sizes=\"(max-width: 1305px) 100vw, 1305px\"><\/noscript><img decoding=\"async\" class=\"alignnone size-full wp-image-3297 lazyload\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201305%20649%22%3E%3C%2Fsvg%3E\" alt width=\"1305\" height=\"649\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201305%20649%22%3E%3C%2Fsvg%3E 1305w\" sizes=\"(max-width: 1305px) 100vw, 1305px\" data-srcset=\"https:\/\/ultering.com\/it4us\/wp-content\/uploads\/2020\/04\/wildfly_datasource_connection_configuration_postgresql_mysql_03-1.jpg 1305w, https:\/\/ultering.com\/it4us\/wp-content\/uploads\/2020\/04\/wildfly_datasource_connection_configuration_postgresql_mysql_03-1-300x149.jpg 300w, https:\/\/ultering.com\/it4us\/wp-content\/uploads\/2020\/04\/wildfly_datasource_connection_configuration_postgresql_mysql_03-1-768x382.jpg 768w\" data-src=\"https:\/\/ultering.com\/it4us\/wp-content\/uploads\/2020\/04\/wildfly_datasource_connection_configuration_postgresql_mysql_03-1.jpg\"><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<!--CusAds0-->\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>ENVIRONMENT Java 13 Wildfly 18 Windows 10 \/ *Nix&nbsp; (also applicable adapting the commands) DRIVER CONFIGURATION The trick is to match the requirements of the participants. They are: &#8211; the application server&#8217;s (the way it requires the configuration) &#8211; the target database version (type of database and version) &#8211; the driver compatible with the target &#8230; <a href=\"https:\/\/ultering.com\/it4us\/?p=3285\" class=\"more-link\">Read More<span class=\"screen-reader-text\"> &#8220;WILDFLY\/JBOSS: POSTGRESQL AND MYSQL DATASOURCE CONFIGURATION&#8221;<\/span> &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[17,179],"tags":[182,184,180,183,175,181],"class_list":["post-3285","post","type-post","status-publish","format-standard","hentry","category-database","category-server","tag-datasource-configuration","tag-drivers","tag-jboss","tag-mysql","tag-postgresql","tag-wildfly-18"],"_links":{"self":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts\/3285","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3285"}],"version-history":[{"count":6,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts\/3285\/revisions"}],"predecessor-version":[{"id":4155,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts\/3285\/revisions\/4155"}],"wp:attachment":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3285"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3285"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3285"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}