| Author |
Getparameter and then display a record--how?
|
Raja Sagar Panamgipalli
Ranch Hand
Joined: Aug 13, 2003
Posts: 109
|
|
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
|
SCJP 1.4<br />SCBCD 1.3
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26496
|
|
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.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
 |
|
|
subject: Getparameter and then display a record--how?
|
|
|