Hi guys what I want to do is once the user has entered the id number it displays the results for the particular record. This works fine however what would I need to do to the following code so if the id number does not exist it produces an error message.
Code can be seen below:
method class:
public static void UPDATEPLAYLIST( ) {
String p = CheckVideos.videoNo.getText();
try {
ResultSet res = stmt.executeQuery(
"SELECT * FROM VIDEOS WHERE VIDEOID = " + p + " ORDER BY VIDEOID");
while (res.next()) {
CheckVideos.information.append(
" "+res.getInt("VIDEOID") + ""
);
} catch (Exception e) {
System.out.println(e);
}
}