JBoss Data Source Configuration document

Source: Internet
Author: User
Tags postgresql jboss

1 new Postgres-ds.xml file

<?xml version= "1.0" encoding= "UTF-8"?>

<datasources>

<local-tx-datasource>

<jndi-name>DefaultDS</jndi-name>

<connection-url>jdbc:postgresql://192.168.0.180:5432/psmp</connection-url>

<driver-class>org.postgresql.Driver</driver-class>

<user-name>pgsql</user-name>

<password>javac</password>

<metadata>

<type-mapping>postgresql 8.0</type-mapping>

</metadata>

</local-tx-datasource>

<local-tx-datasource>

<jndi-name>PostgreSQLDataSource</jndi-name>

<use-java-context>false</use-java-context>

<connection-url>jdbc:postgresql://192.168.0.180:5432/bh_portal_test</connection-url>

<driver-class>org.postgresql.Driver</driver-class>

<user-name>pgsql</user-name>

<password>javac</password>

<metadata>

<type-mapping>postgresql 8.0</type-mapping>

</metadata>

</local-tx-datasource>

</datasources>

2. Copy the Postgres-ds.xml file to the%jboss_home%server/default/deploy directory

3. Modifying the JBoss default data source

The JBoss default database is hypersonicdb and needs to be changed to PostgreSQL.
(1) Delete the hsql-ds.xml under $jboss_home/server/default/deploy

(2) Delete $jboss_home/server/default/deploy/ JMS under the Hsqldb-jdbc2-service.xml, will hsqldb-jdbc-state-service.xml renamed to Postgres-jdbc-state-service.xml. Copy a postgres-jdbc2-service.xml from the $JBOSS_HOME/DOCS/EXAMPLES/JMS and change the name in <depends> to Defaultds.
(3) Modify $jboss_home/server/default/conf/jboss-service.xml <!--attribute name= "Pad" >true</attribute--> Comments are removed.

<mbean code= "Org.jboss.tm.XidFactory"

Name= "Jboss:service=xidfactory" >

<attribute name= "Pad" >true</attribute>

</mbean>

(4) Modify the Standardjbosscmp-jdbc.xml and set the datasource-mapping to Postgre.

<jbosscmp-jdbc>

<defaults>

<datasource>java:/DefaultDS</datasource>

<datasource-mapping>Postgre</datasource-mapping>

(5) Copy the PostgreSQL JDBC driver Postgresql-8.2-506.jdbc3.jar into the $jboss_home//server/default/lib.

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.