• Post Reply Bookmark Topic Watch Topic
  • New Topic

Connect to MSSQL Server  RSS feed

Ivann Ivanoff
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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-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="" />

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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!