• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

data source problem

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thaku Tad


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


thanks a lot
 
What do you have to say for yourself? Hmmm? Anything? And you call yourself a tiny ad.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic