JBoss configuration Database (RPM)

Source: Internet
Author: User
Tags jboss

joss7.1.1 installation succeeded, path is: D:\profession\jboss-as-7.1.1.Final

Mysql-connector-java-5.1.18-bin.jar (MySQL 5.1 driver)

Ojdbc6.jar (Oracle 11g Drive)

I. Configuring a MySQL data source

1. Under D:\profession\jboss-as-7.1.1.Final\modules\com path, create a new folder Mysqldatabase\mysql\main, and will Mysql-connector-java-5.1.18-bin.jar

Put it inside, and create a new XML file Module.xml.

Module.xml file:

<module xmlns= "urn:jboss:module:1.0" name= "Com.mysqldatabase.mysql" >  <resources>    < Resource-root path= "Mysql-connector-java-5.1.18-bin.jar"/>  </resources>  <dependencies>    <module name= "Javax.api"/>   <module name= "Javax.transaction.api"/> <module   name= " Javax.servlet.api "optional=" true "/>   </dependencies></module>

2. Modify the configuration file.
The path is the Standalone.xml file inside the D:\profession\jboss-as-7.1.1.Final\standalone\configuration,

The lookup node finds the DataSources node, and by default JBoss

There is a default data source

<datasource jndi-name= "Java:/mysqlds" pool-name= "Mysqlds" enabled= "true" use-java-context= "true" >                    < Connection-url>jdbc:mysql://localhost:3306/tabel</connection-url>                    <driver>mysql</driver >                    <security>                        <user-name>shy</user-name>                        <password>169</password>                    </security>                </datasource>

Then add the <drivers> node

<driver name= "MySQL" module= "com.mysqldatabase.mysql" >                        <driver-class>com.mysql.jdbc.driver</ Driver-class>                        <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.mysqlxadatasource</ Xa-datasource-class>                    </driver>

3. Complete the modification and restart the server .

II. Configuring an Oracle data source

1. Under D:\profession\jboss-as-7.1.1.Final\modules\com path, create a new folder Oracledatabase\oracle\main and Ojdbc6.jar

Put it inside, and create a new XML file Module.xml.

Module.xml file:

<module xmlns= "urn:jboss:module:1.0" name= "com.oracledatabase.oracle" >  <resources>    < Resource-root path= "Ojdbc6.jar"/>  </resources>  <dependencies>    <module name= " Javax.api "/>   <module name=" Javax.transaction.api "/> <module name=   " Javax.servlet.api "optional = "true"/>   </dependencies></module>

2. Modify the configuration file.

The path is the Standalone.xml file inside the D:\profession\jboss-as-7.1.1.Final\standalone\configuration,

Find node found datasources node,

<datasource jndi-name= "java:/oracleds" pool-name= "Oracleds" enabled= "true" use-java-context= "true" >                    < Connection-url>jdbc:oracle:thin: @localhost:1521:orcl</connection-url>                    <driver>oracle</ driver>                    <security>                        <user-name>sy</user-name>                        <password>169</password >                    </security>                </datasource>

Find the node <drivers>

  <driver name= "Oracle" module= "com.oracledatabase.oracle" >                        <driver-class> Oracle.jdbc.oracledriver</driver-class>                        <xa-datasource-class> Oracle.jdbc.xa.client.oraclexadatasource</xa-datasource-class>                    </driver>

3. Complete the modification and restart the server.

Third, the data source configuration is successful

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.