Switch JBoss default database to mysql

xiaoxiao2021-03-06  111

The default database for JBoss-3.2.3 is Hypersonic. Using the use we need to switch the database to mysql, oracle, etc., need to modify those files?

Below I take the mysql database as an example, switch the JBoss's default database to Mysql.

1. Download the mysql Driver from http://www.mysql.com/downloads/api-jdbc-stable.html, and copy it below $ jboss_disc / server / default / lib.

2, you must delete the HSQLDB-DS.XML below $ jboss_disc / server / default / deploy, add a mysql-ds.xml file, and include the content:

defaultds

JDBC: MySQL: // localhost: 3306 / test com.mysql.jdbc.driver test Test

The database name, user name, and password here are replaced with Test. You need to modify the actual name.

In fact, the hsqldb-ds.xml here is not necessarily deleted, as long as the default name defaultds in JNDI Name does not have a conflict.

3, in $ jboss_disc / server / default / deploy / jms

Mysql-jdbc2-service.xml replaces HSQL-JDBC2-Service.xml. Put them

DEFAULTDS is modified into mysqlds. This file is responsible for the persistent storage of Message Quene.

4. If you want to use the CMP function, you have two ways to modify: add jbosscmp-jdbc.xml to

EJB deployment unit or modification

$ Jboss_disc / server / default / conf / standardjbosscmp-jdbc.xml, edit

Compiling the element Datasource-maping to mysql, like this: Java: / defaultds mysql second method It is relatively simple, because you don't need to pack the app, the shortcomings are to restart JBoss.

Ok, now restart JBOSS, working in the MySQL database.

转载请注明原文地址:https://www.9cbs.com/read-126690.html

New Post(0)