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.