Merrill Higginson,
Thanks for the response.
I was basically interested in knowing all the steps that are required to connect to a remote SQL server 2000 using Struts on JBoss.
After a night of trial and errors, I have finally established the connection.
I am listing the steps to perform this task. It may be helpful to few people.
**********************************************************************
Steps to configure JBoss for MS SQL Server database and Struts
1)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 directory.
2)To configure with non-XA MS SQL Server datasource-copy /docs/examples/jca/mssql-ds.xml to /server/default/deploy directory.
3)To configure with MS SQL Server XA datasource copy /docs/examples/jca/mssql-xa-ds.xml to /server/default/deploy dir. Modify mssql-ds.xml configuration file. Driver Class and Connection URL settings for MS SQL Server JDBC Drivers are as follows:
3.1) <driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver </driver-class>
3.2) <connection-url> jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=MyDatabase
</connection-url>
4) To configure with XA JDBC driver for MS SQL Server modify the mssql-xa-ds.xml configuration file.
4.1) <driver-class>com.microsoft.jdbcx.sqlserver.SQLServerDataSource</driver-class>
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.
6)Make the changes as:
<jbosscmp-jdbc>
<defaults>
<datasource>java:/MSSQLDS</datasource>
<datasource-mapping>MS SQLSERVER2000</datasource-mapping>
</defaults>
</jbosscmp-jdbc>
7) 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">password</module-option>
<module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MSSQLDS>
</module-option>
</login-module>
</authentication>
</application-policy>
By modifying the mssql-ds.xml, standardjbosscmp-jdbc.xml and login-config.xml the JBoss 4.0 server is configured to be used with a MS SQL Server database.
8)Download these two files to use data connection using Struts and copy them to the server/default/lib directory.
1. Commons-pool-1.2.jar
2. Commons-dbcp-1.2.1.jar
Regards,
Jitendra
**********************************************************************