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

Unable to connect to database

 
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Here is my jsp page where i trying to display the data from table. Here form1 is the name of drop down list in my searchuser.jsp page. The content in the drop down list is a name of one column of the database. I am able to connect firstjsp page showing item available in drop down menu.But when I am running this page I am failing to connect it to database.
Whether My marked query is right or wrong?

Any suggestion is highly appreciated.
Thanks and Regards
Harshal
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What's the actual error message of the exception? In which line of the code does the exception happen?

Do you really have a parameter called "form1" that contains an email address?

As a side note, the form you're creating in this page doesn't contain form tags, so you will have problems later on.

And on yet another unrelated note, you should NEVER perform DB accesses in a JSP page; it's considered bad design. Use a servlet or backing bean instead.
[ July 12, 2008: Message edited by: Ulf Dittmer ]
 
Harshal Gurav
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulf,
In my searchuser.jsp page I created drop down list where one can find user. Once user select particular name from drop down list and click on submit, in next page i.e. above posted updateuser.jsp I am trying to obtain the related information available in same table in database. But when I run the updateuser.jsp page it runs successfully and shows the message:
Illegal operation on empty result set.
Here is my search.jsp page

Kindly help me.
Thanks and Regards
harshal

[ July 12, 2008: Message edited by: Harshal Gurav ]
[ July 12, 2008: Message edited by: Harshal Gurav ]
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So the first page has "userid" as the option, while the second page uses that to access the "emailid" field? Sure sounds like a problem :-)
 
Harshal Gurav
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulf,
Thank you very very much.
You are really genius.
Now IF I want to update all this field i.enow showing in updateuser.jsp page into database, Can you suggest me required update code in my updateuser.jsp.
Frankly Speaking I am newbie here.
Thanks and Regards
Harshal
 
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We always recommend newbie's to do some homework first and then if they find anu difficulties in the code that they developed,this is the place to ask their doubts. But for the past few days i look at your post and you seems to be not showing any interest in learning.Instead you want us to do the coding for you.

We already suggest you some method and please go through the sun's website where they had lot of sample code for JDBC and some other sites for the SQL Queries.

If you experience problem after studying those tutorials then ranchers were ready to help you happily...

If you not put your efforts then we can't able to help you..Please don't expect us to do your homework....
 
please buy my thing and then I'll have more money:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic