JBoss4 data source configurations (1)

xiaoxiao2021-03-06  39

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 profile. This article will focus on the following sections: JBoss EJB Deployment Descriptor Oralce Database Configuring the Mysql Database Configuration of the configuration of the SYSBASE database configuration of the DB2 database InfoMix database configuration JBoss EJB Deployment Descriptor Standardjaws.xml (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 Description EJB mapping table Description EJB's Finder method description type map The data source here is a JNDI name, which can get a data source connection through this JNDI. 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 Configuring Oracle has 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. one of them

Label and

The settings of the label are as follows:

Oracle OCI Type 2 Driver

Class: Oracle.jdbc.driver.Oracledriver

URL: JDBC: Oracle: OCI8: @

Oracle OCI Thin Type 4 Driver

Class: Oracle.jdbc.driver.Oracledriver

URL: JDBC: Oracle: Thin: @ : :

Oracle OCI XA Type 2 Driver

Class: Oracle.jdbc.xa.client.OraclexADataSource

URL: JDBC: Oracle: Thin: @ : :

Oracle OCI Type 2 Driver

Class: Oracle.jdbc.driver.OracleDriverURL: JDBC: Oracle: OCI8: @

In Connection URL

Is the computer host name installed in Oracle,

Is the port of the Oracle database,

Is the database name. Next, we will modify the StandardJaws.xml or Jaws.xml configuration file and put

with

This is just the following:

Java: / Oracleds

Oracle8

Next, modify StandardJbossCMP-JDBC.XML or JBossCMP-JDBC.XML configuration files, set

with

Elements use oracle.

Java: / Oracleds

Oracle8

Finally, we need to modify the login-config.xml file to use Oracle, below is the login-config.xml file

element:

"Org.jboss.Resource.security.configuredIndityLoginmodule"

Flag = "Required">

SA

SA

JBoss.jca: service = localtxcm, name = ORACLEDS

Modified Oracle-DS.xml, Standardjaws.xml, StandardJbosscmp-JDBC.XML, and later you can use Oracle in JBoss4. 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 to com.mysql.jdbc.driver

Set as

JDBC: mysql: //

/

,among them

Is the database host name

It is the database name.

Then you need to set Standardjaws.xml or Jaws.xml files.

with

element:

Java: / mysqlds

mysql

It also needs to put the standardjbosscmp-jdbc.xml or jbosscmp-jdbc.xml file

with

The element is set to the following:

Java: / mysqlds

mysql

Finally, modify the login-config.xml file to use MySQL:

"Org.jboss.Resource.security.configuredIndityLoginmodule"

Flag = "Required">

SA

SA

JBoss.jca: service = localtxcm, name = mysqlds

Modified mysql-ds.xml, standardjaws.xml, standardjbosscmp-jdbc.xml, and login-config.xml files can be used on JBOSS to use MySQL.

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

New Post(0)