It's like Rob said. Your query returns zero records. If you want to produce a ResultSet for which rs.next() will return true (at least the first time you call it) then use a query which returns at least one record. In other words, not that query. Or perhaps that query with data which matches something in your database.