�MS SQL Server Database Configuration for JBoss 4.0
1
To configure JBoss 4.0 with MS SQL Server database, MS SQL Server driver classes are required in the Classpath.Copy MS SQL Server JDBC driver class jar files mssqlserver.jar, msbase.jar, msutil.jar to the server/default/lib dir.
2
To configure with non-xa MS SQL Server datasource copy /docs/examples/jca/mssql-ds.xml to /server/default/deploy dir.
To configure with MS SQL Server XA datasource copy /docs/examples/jca/mssql-xa-ds.xml to /server/default/deploy dir.
3
Modify mssql-ds.xml configuration file.
Driver Class and Connection URL settings for MS SQL Server JDBC Drivers
1.Driver Class: com.microsoft.jdbc.sqlserver.SQLServerDriver
2.Connection URL:jdbc:microsoft:sqlserver://localhost:1433;
3.DatabaseName=MyDatabase
To configure with XA JDBC driver for MS SQL Server modify the mssql-xa-ds.xml configuration file.
Driver Class: com.microsoft.jdbcx.sqlserver.SQLServerDataSource
4
The standardjaws.xml file is configured with Hypersonic database by default.
To configure JBoss server with MS SQL Server database modify /server/default/conf/standardjaws.xml configuration file.
Set <datasource> and <type-mapping> elements.
<jaws>
<datasource>java:/MSSQLDS</datasource
<type-mapping>MS SQLSERVER2000</type-mapping>
</jaws>
5
The standardjbosscmp-jdbc.xml configuration file is configured with Hypersonic database.
To configure JBoss server with MS SQL Server modify /server/default/conf/standardjbosscmp-jdbc.xml configuration file.
Set the <datasource> and <datasource-mapping> elements.
<jbosscmp-jdbc>
<defaults>
<datasource>java:/MSSQLDS</datasource>
<datasource-mapping>MS SQLSERVER2000</datasource-mapping>
</defaults>
</jbosscmp-jdbc>
6
Modify login-config.xml configuration file with MS SQL Server database settings.
Add the following <application-policy/> element to login-config.xml.
<application-policy name = "MSSQLDbRealm">
<authentication>
<login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required"> <module-option name = "principal">sa</module-option>
<module-option name = "userName">sa</module-option>
<module-option name = "password"></module-option>
<module-option name ="managedConnectionFactoryName">
jboss.jca:service=LocalTxCM,name=MSSQLDS
</module-option>
</login-module>
</authentication>
</application-policy>
By modifying the
1.mssql-ds.xml
2.standardjaws.xml
3.standardjbosscmp-jdbc.xml
4.and login-config.xml
the JBoss 4.0 server is configured to be used with a MS SQL Server database.
Login Failed for User 'BanManProSQL', Not Associated with a trusted SQL Server Connection.
Is using SQL 2000, you might get the following error:
Microsoft OLE DB Provider for SQL Server error '80004005'
Login failed for user 'BanManProSQL'. Reason: Not associated with a trusted SQL Server connection.
/dbconnect.asp, line 19
This error occurs because by default SQL 2000 does not support SQL Server authentication and supports only Windows authentication. To overcome this limitation:
1.Enter SQL Enterprise Manager.
2.Find your server name in the tree on the left.
3.Right mouse click on the server name and select properties.
4.Click the Security folder. You should now see the screen below with "Windows Only" set as the default authentication.
5.Check SQL Server and Windows as the Authentication.
6.Click OK.
7.Click Yes to restart SQL.