You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jitendra Kumar <ji...@hth.bhel.co.in> on 2006/02/08 12:30:25 UTC

Struts 1.1 issue (myEclipse+Jboss 3.2.5+SQL Server 2000)

I am writing this mail after spending a lot of time struggling with the
stuff mentioned in subject line.

My Setup

1. myEclipse IDE
2. Struts Version 1.1
3. JDK 1.5
4. Jboss 3.2.5 (Please don't ask me to go to Jboss mailing list :-( )

5. SQL Server 2000 (This server is running on a remote win 2000 server)



I am developing this application on a win 2K prof environ.

The Requirement:

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.

If any of you are using the above environment or have knowledge about the
same then please tell me the procedure in steps to achieve the above
mentioned target.

Thanks in advance 


Regards,
Jitendra Kumar



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


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

Posted by Dave Newton <ne...@pingsite.com>.
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