• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Cannot Connect Struts web app to remote sql database

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I there everyone !

I am working in a struts project using MVC, Tomcat and MS SQL 2000.

When a connect the web application to the local host using MYSql database this Datasource works fine :

<data-source type="org.apache.commons.dbcp.BasicDataSource">

<set-property property="driverClassName" value="com.mysql.jdbc.Driver"/>
<set-property property="username" value="root"/>
<set-property property="password" value="tininha"/>
<set-property property="url" value="jdbc:mysql://localhost/newasb" />

</data-source>


But when I am trying to connect the same application to a remote SQL 2000 database using the bellow datasource Tomcat gives me the following error:

type Status report
message Servlet action is not available
description The requested resource (Servlet action is not available) is not available.

Here is the troublesome datasource:

<data-sources>
<data-source type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="driverClassName" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
<set-property property="username" value="svc"/>
<set-property property="password" value="cvs1"/>
<set-property property="url" value="jdbc:microsoft:sqlserver://172.20.2.103:1433/newasb" />

</data-source>
</data-sources>



Can anyone help ??? I have all the .jar for the JDBC for SQL 2000 set in both the project and the classpath.


Jose Cardoso Jr

SCJP
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.

I just had the exact same problem connecting to Oracle. I am running JBoss 4.0.4 and in the server statup it shows that it is setting the servlet to not available because the connection to the database was refused.

Now the main problem with me was connecting remotley and my Oracle TNS not configured correctly, it is corrupt locally so having real problems with that.

The way it was sorted in the end was using a connection string to directly connect to Oracle (I am sure you can do something similar in MySQL or MSSQL)

This is my struts-config datasource, the URL property is where all the action is:


Also make sure you have these classes visible to the server; I have mine in the WEB-INF/lib directory:

The last 2 are Oracle specific I think.

commons-pool-1.3.jar
commons-collections-3.2.jar
jdbc2_0-stdext.jar
classes12.jar
[ June 23, 2006: Message edited by: Martin Thorpe ]
 
Carla carmona
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Martin, I will give it a try and let you know the results

Jo
 
Would anybody like some fudge? I made it an hour ago. And it goes well with a tiny ad ...
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic