This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Cant connect to MSSQL 2005 " Watch "Cant connect to MSSQL 2005 " New topic
Author

Cant connect to MSSQL 2005

Peter Mugisha
Greenhorn

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="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

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.

Thanks
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
binypanackal@gmail.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cant connect to MSSQL 2005
 
Similar Threads
errors occured...for database ..my god~kick my head~
Connection Pooling with Struts
Prob using DataSource
struts+database
DB2 DataSource for Struts