在JBoss安装目录\jboss-4.2.3.GA\docs\examples\jca找到数据源配置如:mysql mssql-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- -->
<!-- JBoss Server Configuration -->
<!-- -->
<!-- ===================================================================== -->
<!-- $Id: mssql-ds.xml 71535 2008-04-01 07:05:03Z
[email protected] $ -->
<!-- ======================================================================-->
<!-- New ConnectionManager setup for Microsoft SQL Server 2005 driver -->
<!-- Further information about the Microsoft JDBC Driver version 1.1 -->
<!-- can be found here: -->
<!-- http://msdn2.microsoft.com/en-us/library/aa496082.aspx -->
<!-- ===================================================================== -->
<datasources>
<local-tx-datasource>
<jndi-name>MSSQLDS</jndi-name>
<connection-url>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=MyDatabase</connection-url>
<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
<min-pool-size>3</min-pool-size>
<max-pool-size>100</max-pool-size>
<user-name>liyong</user-name>
<password>1234</password>
<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is obtained from pool
<check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
-->
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<metadata>
<type-mapping>MS SQLSERVER2000</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
需要把数据库驱动类copy到jboss \jboss-4.2.3.GA\server\default\lib
接下来把这个文件copy到jboss \jboss-4.2.3.GA\server\default\deploy目录