• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Connect to MSSQL Server

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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-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
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic