• 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

Getparameter and then display a record--how?

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,

I'm kinda new to JDBC ...i haven't been able to resolve this problem ..ie..

Consider a html page that takes an employee name ...which through
form method =get action= \servletJdbcVlidation post the parameter to the servlet.
There in the servlet i have the code like follows...


stmt.executeQuery("select passwd from employee where username like"+ vart);
how do i give the String stored in vart to the SQL statement...i dont get the trick in giving the syntax.
plz help.........
thankyou
regards
Sagar
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sagar,
To do an exact match, you need single quotes around the parameter.

Is the user passing in the wildcards in the like clause? If not, you may want to do:

That will return any matches containing the parameter, not just exact matches.
 
Seriously? That's what you're going with? I prefer this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic