File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Cant connect to MSSQL 2005 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Cant connect to MSSQL 2005 " Watch "Cant connect to MSSQL 2005 " New topic

Cant connect to MSSQL 2005

Peter Mugisha

Joined: Aug 23, 2004
Posts: 1
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="" />
<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" />

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?


Gowher Naik
Ranch Hand

Joined: Feb 07, 2005
Posts: 643
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.

biny panackal
Ranch Hand

Joined: Apr 12, 2007
Posts: 72
why is closed twise in yout struts-config.xml file

[ March 11, 2008: Message edited by: biny panackal ]

Biny Balan
I agree. Here's the link:
subject: Cant connect to MSSQL 2005
It's not a secret anymore!