Hello everyone, I'm finishing my first project that involves database and I have problem with one of the sql. I'll try to explain it, please bear with me, my English is not the best.
Basically, I have db with movie titles and i want to display every movie that was released after the date that is entered by the user. For some reason it is showing me only the first one and following message: "ResultSet not open. Verify that autocommit is OFF."
Could someone point me to what I'm doing wrong. Thanks a lot.
public static void New_Release () { PreparedStatement query7; String ReleaseDate = JOptionPane.showInputDialog(null, "Please enter the Date!); try{ String host = "......."; String uName = ""; String uPass = ""; Connection con = DriverManager.getConnection(host); String sql = "SELECT TITLE from DVD WHERE RELEASEDATE > ? "; query7 = con.prepareStatement(sql); query7.setString(1,ReleaseDate); ResultSet rs1 = query7.executeQuery(); while (rs1.next()){ String TITLE = rs1.getString(1); query7.executeQuery(); } // end of while } // end of try catch (SQLException err) { System.out.println(err.getMessage()); } // end of catch } // end of new_release method