JBOSS 6 EAP oracle数据源配置
?中文版在? http://vase.iteye.com/blog/1299425
Create oracle DataSource Steps :
- Install driver as core module
- Create folder at? EAP_HOME/modules/
?
<此处有图片,如不显示请看附件>
Compare with other folders under modules you will find the last folder
Name is main.
我自己的module.xml
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="jdbc.oracle">
? ??
? ? <resources>
? ? ? ? <resource-root path="ojdbc14.jar"/>
? ? ? ??
? ? </resources>
? ? <dependencies>
? ? <module name="javax.api"/>
<module name="javax.transaction.api"/>
? ? </dependencies>
</module>
?
2.Use CLI to install the driver
Under? EAP_HOME/runtimes/jboss-eap/bin? run?? jboss-cli.bat
connect
Copy and modify below content to cmd and run
/subsystem =datasources/jdbc-driver=DRIVER_NAME:add(drivernam
e=DRIVER_NAME,driver-m odule-nam e=MODULE_NAME,driver-xa-datasource-classnam
e=XA_DATASOURCE_CLASS_NAME)
?
example: ? ??
/subsystem =datasources/jdbc-driver=oracle:add(driver-name=oracle,driver-module-name=jdbc.oracle,driver-xa-datasource-class-name=oracle.jdbc.xa.client.OracleXADataSource)
Return success means you have installed the driver
Important? (如果你用的是ORACLE 10G)
这里要注意,因为ojdbc14.jar驱动不是jdbc4驱动,里面的META-INF中没有驱动描述和 一个叫java.sql.Driver的文件,所以我们要在中加入oracle.jdbc.OracleDriver来指定(如果用oralce11的驱动就没必要了)
?
也就是说还要在 standalone.xml作一些修改:
<driver name="oracle" module="jdbc.oracle">
?????????????????????? ?<driver-class>oracle.jdbc.OracleDriver</driver-class>
??????????????????????? <xa-datasource-class>
???????????????????? oracle.jdbc.xa.client.OracleXADataSource
??????????????????????? </xa-datasource-class>
</driver>
?
《Refer to? http://vase.iteye.com/blog/1299425?》?
?
3.Install DataSource
Login in http://localhost:9990/console/App.html#datasources ,make sure? you are in Profile tab (top-right Conner )
Add?
Jndi -------java:jboss/datasource/OracleDS
connection-url----------jdbc:oracle:thin:@localhost:1521:xe
Test at bottom connection tab
?
?
?