此内容没有您所选择的语言版本。

2.4. Configuring a datasource for Microsoft SQL Server 200x


In this section, we'll connect the server to MS SQL Server 2005 using the latest JDBC driver (v2.0) available at http://msdn2.microsoft.com/en-us/data/aa937724.aspx.
To make the JDBC driver classes available to the JBoss Enterprise Application Platform, copy the archive sqljdbc.jar from the sqljdbc_2.0 distribution to the lib directory in the default server configuration (assuming that is the server configuration you’re running).
Then create a text file in the deploy directory called mssql-ds.xml with the following datasource descriptor :
 
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
  <local-tx-datasource>
  <jndi-name>DefaultDS</jndi-name>
  <connection-url>jdbc:sqlserver://localhost:1433;DatabaseName=pubs</connection-url>
  <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
  <user-name>sa</user-name>
  <password>jboss</password>
  <check-valid-connection-sql>SELECT 1 FROM sysobjects</check-valid-connection-sql>
  <metadata>
	  <type-mapping>MS SQLSERVER2000</type-mapping>
  </metadata>
  </local-tx-datasource>
</datasources>
Copy to Clipboard Toggle word wrap
The datasource is pointing at a database pubs provided by default with MS SQL Server 2000.
Remember to update the connection url attributes as well as the username/password combination to match your environment setup.

2.4.1.1. Testing the datasource

Using the test client described in Section 2.6, “Creating a JDBC client”, you may now verify the proper installation of your datasource.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat