{"id":437,"date":"2015-07-18T16:41:31","date_gmt":"2015-07-18T11:11:31","guid":{"rendered":"http:\/\/itechgenie.com\/myblog\/?p=437"},"modified":"2015-07-18T16:52:13","modified_gmt":"2015-07-18T11:22:13","slug":"adding-oracle-datasource-to-jboss-eap-server","status":"publish","type":"post","link":"https:\/\/itechgenie.com\/myblog\/2015\/07\/adding-oracle-datasource-to-jboss-eap-server\/","title":{"rendered":"Adding Oracle Datasource to JBoss EAP server"},"content":{"rendered":"<p>To add a Oracle Datasource to the JBOSS server, follow the steps<\/p>\n<p>1. In the <strong>standalone.xml<\/strong> or in <strong>standalone-full.xml<\/strong><\/p>\n<pre class=\"lang:xhtml decode:true \" title=\"standalone.xml\" >&lt;subsystem xmlns=\"urn:jboss:domain:datasources:1.2\"&gt;\r\n\t\t&lt;datasources&gt;\r\n\t\t\t&lt;datasource jndi-name=\"java:jboss\/datasources\/ExampleDS\" pool-name=\"ExampleDS\" enabled=\"true\" use-java-context=\"true\"&gt;\r\n\t\t\t\t&lt;connection-url&gt;jdbc:h2:tcp:\/\/localhost\/~\/jbpm-db-new;MVCC=TRUE;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE&lt;\/connection-url&gt;\r\n\t\t\t\t&lt;driver&gt;h2&lt;\/driver&gt;\r\n\t\t\t\t&lt;security&gt;\r\n\t\t\t\t\t&lt;user-name&gt;sa&lt;\/user-name&gt;\r\n\t\t\t\t\t&lt;password&gt;sa&lt;\/password&gt;\r\n\t\t\t\t&lt;\/security&gt;\r\n\t\t\t&lt;\/datasource&gt;\r\n\t\t\t&lt;datasource jndi-name=\"java:jboss\/datasources\/JbpmDS\" pool-name=\"JbpmDS\" enabled=\"true\" use-java-context=\"true\"&gt;\r\n\t\t\t\t&lt;connection-url&gt;jdbc:oracle:thin:@localhost:1521:XE&lt;\/connection-url&gt;\r\n\t\t\t\t&lt;driver&gt;oracle&lt;\/driver&gt;\r\n\t\t\t\t&lt;security&gt;\r\n\t\t\t\t\t&lt;user-name&gt;username&lt;\/user-name&gt;\r\n\t\t\t\t\t&lt;password&gt;password&lt;\/password&gt;\r\n\t\t\t\t&lt;\/security&gt;\r\n\t\t\t&lt;\/datasource&gt;\r\n\t\t\t&lt;drivers&gt;\r\n\t\t\t\t&lt;driver name=\"h2\" module=\"com.h2database.h2\"&gt;\r\n\t\t\t\t\t&lt;xa-datasource-class&gt;org.h2.jdbcx.JdbcDataSource&lt;\/xa-datasource-class&gt;\r\n\t\t\t\t&lt;\/driver&gt;\r\n\t\t\t\t&lt;driver name=\"oracle\" module=\"com.oracle.jdbc\"&gt;\r\n\t\t\t\t\t&lt;driver-class&gt;oracle.jdbc.driver.OracleDriver&lt;\/driver-class&gt;\r\n\t\t\t\t\t&lt;xa-datasource-class&gt;oracle.jdbc.xa.client.OracleXADataSource&lt;\/xa-datasource-class&gt;\r\n\t\t\t\t&lt;\/driver&gt;\r\n\t\t\t&lt;\/drivers&gt;\r\n\t\t&lt;\/datasources&gt;\r\n&lt;\/subsystem&gt;<\/pre>\n<p>2. In <strong>$JBOSS_HOME\/modules\/com\/oracle\/jdbc\/main<\/strong> I have copied the <strong><a href=\"http:\/\/www.oracle.com\/technetwork\/apps-tech\/jdbc-112010-090769.html\" title=\"Oracle JDBC Driver\" target=\"_blank\">ojdbc6.jar<\/a><\/strong> and created the <strong>module.xml<\/strong> file.<\/p>\n<pre class=\"lang:xhtml decode:true \" >&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;module xmlns=\"urn:jboss:module:1.0\" name=\"com.oracle.jdbc\"&gt;\r\n  &lt;resources&gt;\r\n    &lt;resource-root path=\"ojdbc6.jar\"\/&gt;\r\n  &lt;\/resources&gt;\r\n  &lt;dependencies&gt;\r\n    &lt;module name=\"javax.api\"\/&gt;\r\n    &lt;module name=\"javax.transaction.api\"\/&gt;\r\n  &lt;\/dependencies&gt;\r\n&lt;\/module&gt;<\/pre>\n<p>3. Now you could use the JNDI &#8220;java:jboss\/datasources\/JbpmDS&#8221; in your application<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To add a Oracle Datasource to the JBOSS server, follow the steps 1. In the standalone.xml or in standalone-full.xml &lt;subsystem xmlns=&#8221;urn:jboss:domain:datasources:1.2&#8243;&gt; &lt;datasources&gt; &lt;datasource jndi-name=&#8221;java:jboss\/datasources\/ExampleDS&#8221; pool-name=&#8221;ExampleDS&#8221; enabled=&#8221;true&#8221; use-java-context=&#8221;true&#8221;&gt; &lt;connection-url&gt;jdbc:h2:tcp:\/\/localhost\/~\/jbpm-db-new;MVCC=TRUE;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE&lt;\/connection-url&gt; &lt;driver&gt;h2&lt;\/driver&gt; &lt;security&gt; &lt;user-name&gt;sa&lt;\/user-name&gt; &lt;password&gt;sa&lt;\/password&gt; &lt;\/security&gt; &lt;\/datasource&gt; &lt;datasource jndi-name=&#8221;java:jboss\/datasources\/JbpmDS&#8221; pool-name=&#8221;JbpmDS&#8221; enabled=&#8221;true&#8221; use-java-context=&#8221;true&#8221;&gt; &lt;connection-url&gt;jdbc:oracle:thin:@localhost:1521:XE&lt;\/connection-url&gt; &lt;driver&gt;oracle&lt;\/driver&gt; &lt;security&gt; &lt;user-name&gt;username&lt;\/user-name&gt; &lt;password&gt;password&lt;\/password&gt; &lt;\/security&gt; &lt;\/datasource&gt; &lt;drivers&gt; &lt;driver name=&#8221;h2&#8243; module=&#8221;com.h2database.h2&#8243;&gt; &lt;xa-datasource-class&gt;org.h2.jdbcx.JdbcDataSource&lt;\/xa-datasource-class&gt; &lt;\/driver&gt; &lt;driver name=&#8221;oracle&#8221; module=&#8221;com.oracle.jdbc&#8221;&gt; &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/itechgenie.com\/myblog\/2015\/07\/adding-oracle-datasource-to-jboss-eap-server\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Adding Oracle Datasource to JBoss EAP server&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5,65,12],"tags":[70,67,66,68,71,72,69],"class_list":["post-437","post","type-post","status-publish","format-standard","hentry","category-how-to","category-jboss-eap-jbpm","category-utility","tag-datasource","tag-eap","tag-jboss","tag-jbpm","tag-jndi","tag-oracle","tag-redhat"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2HHtz-73","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/itechgenie.com\/myblog\/wp-json\/wp\/v2\/posts\/437","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itechgenie.com\/myblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itechgenie.com\/myblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itechgenie.com\/myblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itechgenie.com\/myblog\/wp-json\/wp\/v2\/comments?post=437"}],"version-history":[{"count":3,"href":"https:\/\/itechgenie.com\/myblog\/wp-json\/wp\/v2\/posts\/437\/revisions"}],"predecessor-version":[{"id":440,"href":"https:\/\/itechgenie.com\/myblog\/wp-json\/wp\/v2\/posts\/437\/revisions\/440"}],"wp:attachment":[{"href":"https:\/\/itechgenie.com\/myblog\/wp-json\/wp\/v2\/media?parent=437"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itechgenie.com\/myblog\/wp-json\/wp\/v2\/categories?post=437"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itechgenie.com\/myblog\/wp-json\/wp\/v2\/tags?post=437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}