}
public Booking getMaxBookingByResource(Resource resource)
throws ResourceNotBookedException, DAOException {
Booking booking = new Booking();
try {
String command = "SELECT * FROM Booking WHERE ResourceID = ? AND Week = (SELECT MAX(Week) FROM Booking WHERE ResourceID = ?)";
PreparedStatement statement = JdbcConnection.getConnection()
.prepareStatement(command);
statement.setInt(1, resource.getResourceID());