Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cant connect to MSSQL 2005

 
Peter Mugisha
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I am a struts newbie having trouble connecting to an MS Sql 2005 Database. I added the following code to the struts-config.xml file (struts version: 1.2.9)

<data-source type="org.apache.commons.dbcp.BasicDataSource" key="empTable">
<set-property property="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
<set-property property="url" value="jdbc:sqlserver://HOMEBASE;InstanceName=sql2005;DatabaseName=ProjectIdeas" />
<set-property property="username" value="admin" />
<set-property property="password" value="testpwd" />
<set-property property="userlist" value="SELECT * FROM Users" />
</data-source>
</data-sources>

when i run the application, i get the error "HTTP Status 404 - Servlet action is not available".

It seems to work fine, when I use the derby driver org.apache.derby.jdbc.ClientDriver
Could this be a struts version issue?

regards

ptah.
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First connect MSSQL using simple stand alone JDBC program.
If it working fine then use Struts.
You have to install latest service pack for JDBC on MSSQL server.

Thanks
 
biny panackal
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why is closed twise in yout struts-config.xml file

[ March 11, 2008: Message edited by: biny panackal ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic