In the location denoted by ****** in the SQL statement, I used findkey variable. This caused an error, I guess the SQL statement does not recognize the java variable. I also tried r.getString("user_Name") where r is my resultset. That didn't work too. I tried enclosing r.getString("user_Name") within <%= %> since this code is from a jsp file. That doesn't work too. What should I do? ------------------ Regards, Shree
Regards,<BR>Shree
Simon Brown
sharp shooter, and author
Ranch Hand
Joined: May 10, 2000
Posts: 1860
posted
0
I think I can see what you're asking ... have you tried the following? ResultSet r=s.executeQuery("SELECT user_Name FROM user_Details WHERE user_Name = " + findKey); instead of ResultSet r=s.executeQuery("SELECT user_Name FROM user_Details WHERE user_Name = *******"); Regards Simon ------------------ Simon Brown Co-author of Professional JSP 2nd Edition
Simon Brown
sharp shooter, and author
Ranch Hand
Joined: May 10, 2000
Posts: 1860
posted
0
Or, if user_name is a String on the database, you might need to do the following (notice the extra ' characters)... ResultSet r=s.executeQuery("SELECT user_Name FROM user_Details WHERE user_Name = "'" + findKey + "'");
Originally posted by Simon Brown: ResultSet r=s.executeQuery("SELECT user_Name FROM user_Details WHERE user_Name = " + findKey);