Close
jGuru Forums
Posted By: vignesh_bala Posted On: Thursday, September 7, 2006 04:58 AM
Hi, I have a small problem.
I am using oracle thin driver and querying to a database using prepared ststement. I am using the following code snippet pstmt = con.prepareStatement("SELECT ACCTNBR FROM MOBILE WHERE MOBILE= ?"); pstmt.setString(1,"123456"); rs = pstmt.executeQuery(); while (rs.next()) { System.out.println(rs.getString(1)); } . If I give like this,The resultset is not at all populated and the output is not printed. But if I hard code the value like pstmt = con.prepareStatement("SELECT ACCTNBR FROM MOBILE WHERE MOBILE= '123456'"), then It sucessfully prints the output. I haven't changed anything in my first and second attempt. can anybody suggest why this occurs. Please. Regards, Vignesh
Re: A small error
Posted By: WarnerJan_Veldhuis Posted On: Thursday, September 7, 2006 05:27 AM