I.. JBOSS7 directory Structure
In JBoss 7, the file system is divided into two parts:
1. Standalone Server2. Domain Server (This is the first introduction of JBoss 7)-for unified management of multiple instances
BIN: Contains a startup script to start a standalone server (if using a standalone instance) or a domain (using a domain server)
DOCS: Contains server documentation with two subdirectories, Licenses (Licenses.xml and related content) and Schema (the. xsd file used by the configuration)
Domains: Contains the domain structure, a subdirectory consists of a configuration file containing the domain, data (the content folder containing the published module), and Lib (for Java EE extensions) TMP (temporary directory).
STANDALONE: Structure and Domain folder are the same
MODULES: Because JBoss 7 is a modular server, the module for the application server corresponds to a subdirectory here
second, the data source configuration
A, download oracle10g JDBC driver--Ojdbc6.jar B. Place this jar file in the JBOSS7 folder \modules\com\oracle\main (Oracle, Main) to create a new folderc. Write the Module.xml file code in the main file as follows
<span style= "font-family:fangsong_gb2312;" ><?xml version= "1.0" encoding= "UTF-8"? ><module xmlns= "urn:jboss:module:1.0" <span style= "color:# ff0000; " >name= "Com.oracle" </span>> <resources><!--Insert Resources here--><resource-root Path= "<span style=" color: #33cc00; " >ojdbc6.jar</span> "/> </resources> <dependencies> <module name=" Javax.api "/> <module name=" Javax.transaction.api "/> </dependencies></module></ Span>
D, after completing the above steps, in the Jboss7 folder under Standalone\configuration, modify the Standalone.xml file on the data source Datassource changes
The code is as follows:
<span style= "font-family:fangsong_gb2312;" ><subsystem xmlns= "urn:jboss:domain:datasources:1.0" > <datasources> <DATASOURC E jndi-name= "MyDS" pool-name= "MyDS" enabled= "true" Jta= "true" use-java-context= "true" use-ccm= "true" > <connection-url>jdbc:oracle:thin: @address: 1521: Instance name </connection-url> <driver-class>o racle.jdbc.driver.oracledriver</driver-class> <driver><span style= "color: #000099;" >oracle</span></driver> <pool> <min-pool-size>30</ Min-pool-size> <max-pool-size>50</max-pool-size> <prefill& Gt;true</prefill> <use-strict-min>false</use-strict-min> & Lt;flush-strategy>failingconnectiononly</flush-strategy> </pool> <security> <user-name>sa</user-name> <passwo Rd>sa</password> </security> </datasource> <drivers> <driver <span style= "color: #000099;" >name= "Oracle" </span> <span style= "color: #ff0000;" >module= "Com.oracle</span>" > <xa-datasource-class>oracle.jdbc.xa.client.oraclexad atasource</xa-datasource-class> </driver> </drivers> </d Atasources> </subsystem></span>
Iii. Summary
Newer versions of JBoss incorporate two new concepts compared to older versions of JBoss, one for managing multiple servers through domain, and one for modular concepts. Due to the concept of modularity, the new version of the data source is not the same as before the MySQL data source driver into the specified Lib directory, copy a copy of the data source configuration file to the deployment directory to modify, in the new version of the data source will need to be integrated into jboss in a modular way, Therefore, the basis for configuring the data source is to understand the concept of modularity in the new version of JBoss . Of
course, the configuration of MySQL and other database data sources is the same as the previous steps.
JBOSS7 Configuring an Oracle data source