The developer version of JBoss 4.0 is an open source application server, and he takes HyperSonicDB as his default database. However, developers may also use a database other than HyperSonicDB, in which we will see how to configure other databases on JBoss.
Introduction
JBoss4.0 uses a JDBC profile to configure database connections, which provides data sources for EJBs and other J2EE applications. If you want to use the database other than HypersonicDB, you will modify this 雠 雠 梦 陆 陆 庀 庀 庀 庀 庀 娴 父 数据 数据 数据 数据 数据 数据 数据 数据 数据 数据 数据 数据 数据 数据 数据 数据 数据 数据 数据 数据 数据Configuring the configuration of the Sysbase database DB2 database configuration infromix database configuration JBoss EJB deployment descriptor
Standardjaws.xml (located in x: / jboss4 / server / default / conf) is a standard deployment description file that maps CMP entity EJB. It is used to configure CMP entity EJB, you can also use jaws.xml instead. You can copy this file Copy to the meta-inf directory in the EJB .jar file. This file is used to describe the following information:
Describe a data source and mapping type. Describe the table description type mapping of EJB mapping
The data source here is a JNDI name that can be obtained through this JNDI to obtain a data source connection pool. JBoss4 default data sources are HypersonicDB. If you need to use other data sources, you need to modify the jaws.xml file.
Standardjbosscmp-jdbc.xml (in x: / jboss4 / server / default / conf) is a standard deployment description file configured for the JBoss CMP container, you can also use a custom profile -jbosscmp-jdbc.xml instead of it. This file is also placed in the meta-INF directory of the EJB.jar file. It is also a need to modify it by default or hypersonicDB as a database.
Oracle database configuration
Oracle is a very popular enterprise database with its operational stability and reliability. To configure Oracle on JBOSS, what is the first thing we have to do is to copy the Oracle's JDBC driver to ClassPath. We copied this JDBC driver to the server / default / lib directory. In order to use Oracle's transaction processing data source we must also copy /DOCS/examples/jca/oracle-xa-ds.xml to the / Server / Default / Deploy directory. If you use a non-transactional data source, copy the /DOCS/examples/jca/oracle-ds.xml file to the / Server / Default / Deploy directory. Next, we need to modify the Oracle-de.xml configuration file. The
Oracle OCI Type 2 DriverClass: Oracle.jdbc.driver.Oracledriver URL: JDBC: Oracle: OCI8: @
Next, modify the StandardJbossCMP-JDBC.XML or JBOSSCMP-JDBC.XML configuration file, set
Finally, we need to modify the login-config.xml file to use Oracle, below is the
MySQL database configuration
MySQL is an open source database, with many open source projects and small communities are using it. To use MySQL in JBoss4, first you want to put the mysql JDBC in the classpath. Similarly, copy it to the / server / default / lib directory, copy /DOCS/examples/jca/mysql-ds.xml to the / Server / Default / Deploy directory. Modify the mysql-ds.xml file, set
Then you need to set the
Also need to set the
Finally, modify the login-config.xml file to use MySQL:
Modified mysql-ds.xml, standardjaws.xml, standardjbosscmp-jdbc.xml, and login-config.xml files can be used on JBOSS to use MySQL.
SYSBASE database configuration
Sybase Adaptive Server Enterprises (ASE) is the Sysbase's database server. ASE can be used on UNIX and Linux platforms. Similarly, we have to drive its database to the classpath, copy it into the / server / default / lib directory, then copy the /DOCS/examples/jca/sybase-ds.xml to / Server / Default / Deploy directory . Modify the Sybase-DS.xml file to set
Modify the
Finally modify the login-config.xml file to use the SYSBASE database. Set the
DB2 database configuration
IBM's DB2 is a perfect, easy to use the database server, which can be used on Linux, UNIX, and Windows platforms. Use DB2 on JBoss4 as long as you copy db2java.zip to the / Server / Default / Lib directory. Then copy the /DOCS/examples/jca/db2-ds.xml to / Server / Default / Deploy directory, then modify the
Here is the corresponding StandardJbosscmp-JDBC.XML (or JBossCMP-JDBC.XML) file:
Finally, add the following in the Login-Config.xml file:
Informix database configuration
IBM's INFOXMIX database server is used as a data warehouse, analysis and reporting. Use the Informix database on JBoss4, first copy it to the / server / default / lib directory, then copy / server / default / deploy, then copy / serve / default / deploy / server / default / deploy In the directory, if you use a transaction (XA) JDBC, copy the /DOCS/examples/jca/informix-xa-ds.xml file.
The next step is to modify this Informix-DS.xml file, set the
Set the
Finally, add
This way, you can use the Informix database in JBOSS4.
in conclusion
JBoss4 uses the Hypersonic database by default, but if you see us as long as you have a simple modification of several configuration files, you can use the popular different databases on the market.