wood burning stoves 2.0*
The moose likes Struts and the fly likes Connect to MSSQL Server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Connect to MSSQL Server" Watch "Connect to MSSQL Server" New topic
Author

Connect to MSSQL Server

Ivann Ivanoff
Greenhorn

Joined: Oct 09, 2006
Posts: 4
Good day to all!

I have some web-application(build in Struts), this application good working with MySQL database, but our customers want to use this application with MSSQL database. And i change only datasource in struts-config.xml! My struts-config.xml:
<data-sources>
<data-source key="t3" type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="minCount" value="" />
<set-property property="password" value="" />
<set-property property="maxCount" value="" />
<set-property property="user" value="sa" />
<set-property property="driverClassName" value="com.microsoft.jdbc.sqlserver.SQLServerDriver" />
<set-property property="description" value="t3" />
<set-property property="url" value="jdbc:sqlserver://localhost:1433;DatabaseName=t3" />
<set-property property="autoCommit" value="false" />
<set-property property="readOnly" value="false" />
<set-property property="loginTimeout" value="" />
</data-source>
</data-sources>

i starting application and try to login (logins and passwords saved in database), but Tomcat writing this error:
type Status report
message Servlet action is not available
description The requested resource (Servlet action is not available) is not available.

What here it is not correct? Prompt please
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I know this may sound like an un-helpful response, but my advice is to stop using the Struts datasource utility altogether. It works sometimes, but not for all databases, and not for all platforms. There have been posts on this forum indicating that it worked fine in development on a Windows platform, but didn't work when deployed to a Unix platform. If you search this forum you will find many instances of problems with this interface, many of which have gone unsolved.

Your best bet is to define the DataSource as a JNDI resource in your application server and then do a JNDI lookup in your application to retrieve it.

I'm not saying there isn't a way to solve this problem and continue using the Struts datasource utility, but I'm just making you aware that using it has been problematic for others.


Merrill
Consultant, Sima Solutions
 
GeeCON Prague 2014
 
subject: Connect to MSSQL Server