Unable to define oracle datasource on Jboss AS 7

前端 未结 5 1612
余生分开走
余生分开走 2021-01-18 16:58

I\'m using Jboss AS 7.1.1.final and I\'m trying to add an oracle Datasource:



        
相关标签:
5条回答
  • 2021-01-18 17:16

    Add this to define driver: for xa datasource

    <driver name="oracleDriver" module="com.oracle.ojdbc">
             <driver-class>oracle.jdbc.OracleDriver</driver-class>
             <xa-datasource-class>oracle.jdbc.xa.OracleXADataSource
    

    for non-xa-------

    <driver name="oracleDriver" module="com.oracle.ojdbc">
             <driver-class>oracle.jdbc.OracleDriver</driver-class>
        </driver>
    
    0 讨论(0)
  • 2021-01-18 17:17

    Path for the ojdbc jar in my case was : D:\ProgramFiles\JBoss6.4\modules\com\oracle\jdbc7\main where D:\ProgramFiles\JBoss6.4\ is the JBOSS HOME directory.

    in the main folder, need to have following files.

    ojdbc7.jar
    module.xml
    

    Entry for Module would look like below:

    <?xml version="1.0" encoding="UTF-8"?>
    <module xmlns="urn:jboss:module:1.1" name="com.oracle.jdbc7">
    <properties>
            <property name="jboss.api" value="unsupported"/>
        </properties>
     <resources>
     <resource-root path="ojdbc7.jar"/>
     </resources>
     <dependencies>
     <module name="javax.api"/>
     <module name="javax.transaction.api"/>
     <module name="javax.servlet.api" optional="true"/>
     </dependencies>
    </module>
    
    0 讨论(0)
  • 2021-01-18 17:22

    Got the answer:

    In the drivers section, I defined the driver as sitting in module "com.oracle.ojdbc" but the module itself is actually defined with capital 'O' in 'Oracle' so it should be "com.Oracle.ojdbc"

    0 讨论(0)
  • You can define datasource from admin interface, find good tutorial below

    http://middlewaremagic.com/jboss/?p=350

    0 讨论(0)
  • 2021-01-18 17:36

    Add this to define driver: for xa datasource

    <driver name="oracleDriver" module="com.oracle.ojdbc">
             <driver-class>oracle.jdbc.OracleDriver</driver-class>
             <xa-datasource-class>oracle.jdbc.xa.OracleXADataSource</xa-datasource-class>
    </driver>
    

    for non-xa-------

    <driver name="oracleDriver" module="com.oracle.ojdbc">
             <driver-class>oracle.jdbc.OracleDriver</driver-class>
        </driver>
    
    0 讨论(0)
提交回复
热议问题