You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dave Newton <ne...@pingsite.com> on 2006/02/08 13:17:32 UTC

[OT] Re: Struts 1.1 issue (myEclipse+Jboss 3.2.5+SQL Server 2000)

Jitendra Kumar wrote:
> Using the above I simply want to print the records of any table in my SQL
> Server 2K DB.
>
> The problem:
> I am not able to do the above. I have tried changing some files in Jboss. I have copied some jars of DB Drivers in WEB-INF/lib folder etc.
>   
http://www.catb.org/~esr/faqs/smart-questions.html
<http://www.catb.org/%7Eesr/faqs/smart-questions.html>

By what mechanism would you expect us to be able to answer this question?

Besides the fact that this has absolutely nothing to do with Struts, you
have provided essentially zero information that would allow us to even
BEGIN to help. Do you get an error? If so, what error? What JARS are you
using? How are you accessing the database?

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: [OT] Re: Struts 1.1 issue (myEclipse+Jboss 3.2.5+SQL Server 2000)

Posted by Jitendra Kumar <ji...@hth.bhel.co.in>.
Dave,

Thanks for your response. I have got your point and will try to follow
the guidelines from my next mail on.

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

-----Original Message-----
From: Dave Newton [mailto:newton@pingsite.com] 
Sent: Wednesday, February 08, 2006 5:48 PM
To: Struts Users Mailing List
Subject: [OT] Re: Struts 1.1 issue (myEclipse+Jboss 3.2.5+SQL Server
2000)


Jitendra Kumar wrote:
> Using the above I simply want to print the records of any table in my 
> SQL Server 2K DB.
>
> The problem:
> I am not able to do the above. I have tried changing some files in 
> Jboss. I have copied some jars of DB Drivers in WEB-INF/lib folder
etc.
>   
http://www.catb.org/~esr/faqs/smart-questions.html
<http://www.catb.org/%7Eesr/faqs/smart-questions.html>

By what mechanism would you expect us to be able to answer this
question?

Besides the fact that this has absolutely nothing to do with Struts, you
have provided essentially zero information that would allow us to even
BEGIN to help. Do you get an error? If so, what error? What JARS are you
using? How are you accessing the database?

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org