fix for Issue #26 : while loop should not be used to check valid database
entry for single entity

replaced while(rs.next()) or while(ps.executeQuery().next()) , by
if(ps.executeQuery().next())

Signed-off-by: Ashish Namdev <ashish28.sirt@gmail.com>