store a mysql value

Hi experts, how can I amend this java code to store the idnum in a variable?

ResultSet rs1 = stmt.executeQuery("select idnum from users where name like '" + name + "'" );

Cheers
RonayneAsked:
Who is Participating?
 
RonayneConnect With a Mentor Author Commented:
That question has been answered for me here:

http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_20947166.html

Apologies, I should have posted this sooner.
0
 
KarcOriginCommented:
String var = rs1.getString("idnum");
Thx
0
 
KarcOriginCommented:

:-(

(!!u!!)


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.