Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Connect to MSSQL Server

 
Greenhorn
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-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
  • 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.
 
eat bricks! HA! And here's another one! And a tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic