background image
11.
<
new
-connection-sql>some arbitrary sql</
new
-connection-sql>
12.
-->
13.
<!-- sql to call on an existing pooled connection when it is obtain
ed from pool
14.
<check-valid-connection-sql>some arbitrary sql</check-valid-connect
ion-sql>
15.
-->
16.
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (o
ptional)
17.
-->
18.
<metadata>
19.
<type-mapping>MS SQLSERVER2000</type-mapping>
20.
</metadata>
21.
</local-tx-datasource>
22.
</datasources>
注意:其中 MSSQL 是对应 jndi 的名字,可随意改变。192.168.100.112 是测试用的服
务器 ip,根据实际情况设置。test 是数据库名字,mssql-ds.xml 只是对应 sqlsever 服务
器的文件,如果是其他数据库要对应生成不同的 xml 文件。在 jboss\docs\examples\jca
路径中有相对应各个不同服务器的 xml 文件,只需在其基础上做修改即可用
在以前部署的 WebReport.war/web-inf 文件夹中创建 Jboss-web.xml,具体内容如下:
1.
<?xml version=
'1.0'
encoding=
'UTF-8'
?>
2.
<!DOCTYPE jboss-web
3.
PUBLIC
"-//JBoss//DTD Web Application 2.3V2//EN"
4.
"http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd"
>
5.
<jboss-web>
6.
<resource-ref>
7.
<res-ref-name>MSSQL</res-ref-name>