jboss4版本以上
修改mssql-ds.xml拷到web应用的目录下
<?xml version="1.0" encoding="UTF-8"?>
<!-- ================= ==================
==================
================ -->
<!-- -->
<!-- JBoss Server Configuration -->
<!-- -->
<!-- ================= ==================
==================
================ -->
<!-- $Id: mssql-ds.xml,v 1.3 2004/09/15 14:37:40 loubyansky Exp $ -->
<!-- ================= ==================
==================
=================-->
<!-- New ConnectionManager setup for Microsoft SQL Server 2000 driver -->
<!-- You may download the latest Microsoft JDBC driver from *Microsoft* -->
<!-- http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/MSDN-FILES/027/001/779/msdncompositedoc.xml&frame=true -->
<!-- ================= ==================
==================
================ -->
<datasources>
<local-tx-datasource>
<jndi-name>CHISDATASOURCE</jndi-name>
<use-java-context>false</use-java-context> <!--注意这一段-->
<connection-url>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=bschis</connection-url>
<driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
<user-name>sa</user-name>
<password>123</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>
修改mssql-ds.xml拷到web应用的目录下
<?xml version="1.0" encoding="UTF-8"?>
<!-- =================
<!-- -->
<!-- JBoss Server Configuration -->
<!-- -->
<!-- =================
<!-- $Id: mssql-ds.xml,v 1.3 2004/09/15 14:37:40 loubyansky Exp $ -->
<!-- =================
<!-- New ConnectionManager setup for Microsoft SQL Server 2000 driver -->
<!-- You may download the latest Microsoft JDBC driver from *Microsoft* -->
<!-- http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/MSDN-FILES/027/001/779/msdncompositedoc.xml&frame=true
<!-- =================
<datasources>
<local-tx-datasource>
<jndi-name>CHISDATASOURCE</jndi-name>
<use-java-context>false</use-java-context> <!--注意这一段-->
<connection-url>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=bschis</connection-url>
<driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
<user-name>sa</user-name>
<password>123</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>