Hi all.
I am trying to view certain date (that has been chosen by user input) and display it on the screen.
The idea of this Select statement is that it should displayed all room number and dates it has been booked for.
So if the user inputs room CG123 it should display all the dates (start and end) it has been book for.
I need help trying to display the results.
Code:
System.out.println("View Booked Room\n"); System.out.println("Enter Room Number:"); String roomava = s.next(); try { String sql2 = "SELECT ROOMNUMBER, STARTDATE, ENDDATE FROM " + "BOOKINGS WHERE ROOMNUMBER=?"; PreparedStatement ps2 = conn.prepareStatement(sql2); ps2.setString(1, roomava); ps2.executeQuery(); } catch (Exception e) { System.err.println("Error. Please check input entry and date format"); } break;