This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
i have the following method that takes a username and makes a like query as follows:
In my table guesttbl there are two user don and dil, however when i run the method as username 'd' as parameter above it returns only one row which is don.
When i execute the same query directly in mysql it returns 2 rows don and dil.
I can't unserstand why my method is returning only one row when it should return 2(dil,don).
I am missing something here, any suggestion please?
This is what excatly Jan Cumps want to convey to you. When you call 'result.next()' in the System.out.println() method, it will move to the next value in the resultset. so you are not getting the details of first element in the while loop