• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Joe Ess
  • salvin francis
  • fred rosenberger

Getparameter and then display a record--how?

Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • 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.........
author & internet detective
Posts: 39789
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
You don't like waffles? Well, do you like this tiny ad?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!