aspose file tools*
The moose likes Struts and the fly likes data source problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "data source problem" Watch "data source problem" New topic
Author

data source problem

Swathi Prakash
Ranch Hand

Joined: Jan 18, 2005
Posts: 49
hai ,

i am using <data-source> tag to connect mysql.This is my first application using data-source. i tried this small application. i got the error "SERVLET ACTION IS CURRENTLY UNAVAILABLE"

i entered user name.in next page i want to display is password in next page which is in mysql database.


my coding:
In action class:

name1=dataform.getName();
DataSource datasource = getDataSource(request);
Connection myConnection = datasource.getConnection();
rs=stmt.executeQuery("select password from login where name=\""+name1+"\"");
if(rs.next())
{
target="success";
password1=rs.getString("password");
dataform.setPass(password1);
}

in my struts-config


<data-sources>
<data-source
driverClass="org.gjt.mm.mysql.Driver"
password="root"
url="jdbc:mysql://localhost/indigotx"
user="root"/>
</data-sources>

i dont know why the error occurs. plzzz help me to find out the solution.

Thanks in Advance
Tad Dicks
Ranch Hand

Joined: Nov 16, 2004
Posts: 264
the setup that works for me (at least on one machine) is:



you might also want to try using a different jdbc driver

-Tad
Swathi Prakash
Ranch Hand

Joined: Jan 18, 2005
Posts: 49
Thaku Tad


i Got it. it works fine.thanku for ur help. i changed my jdbc as mysql connector.


thanks a lot
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: data source problem