I have the following code
Statement stmt = SqlHelper.initializeDB(); String query = "SELECT status " + "FROM books " + "WHERE bookId = '" + bookId + "'"; ResultSet rs = stmt.executeQuery(query); result = rs.getString(1); rs.close(); SqlHelper.closeConnection();
Do I need to use rs.next()? I am sure there is only going to be one row of data because bookId must be unique in the table. But by default, the cursor of ResultSet starts before the first row so I'm not sure if I need next() or not.