@Override
	public List<User> getUserOnOrderId(int orderId) throws StorageException {
		ResultSet rs = null;
	    Connection conn = null;
	    PreparedStatement pstmt = null;
	    users.clear();
	    
	    try {
			conn = Database.getConnection();
			
			String query = "SELECT users.id as user_id, users.firstname, users.surname, users.street_address, "
								+ "users.post_code, users.email, users.password, users.town, users.telephone "
						 + "FROM users "
						 + "INNER JOIN orderlines "
						 + "ON users.id = orderlines.users_id "
						 + "INNER JOIN orders "
						 + "ON orderlines.orders_id = orders.id "
						 + "WHERE orders.id = ? "
						 + "GROUP BY user_id;";
			
			pstmt = conn.prepareStatement(query);
			
			pstmt.setInt(1, orderId);
			
			rs = pstmt.executeQuery();
			
			// Display all the data in the table.
			while (rs.next()) {
				User tempUser = new User(rs.getInt("user_id"));
				tempUser.setEmail(rs.getString("email"));
				tempUser.setPassword(rs.getString("password"));
				tempUser.setFirstName(rs.getString("firstname"));
				tempUser.setSurName(rs.getString("surname"));
				tempUser.setStreetAddress(rs.getString("street_address"));
				tempUser.setPostCode(rs.getString("post_code"));
				tempUser.setTown(rs.getString("town"));
				tempUser.setTelephone(rs.getString("telephone"));
				
				users.add(tempUser);
	        }
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
			throw new StorageException(e.getMessage());
		} catch (SQLException e) {
			e.printStackTrace();
			throw new StorageException(e.getMessage());
		} finally {
			try {
				if(rs != null) {
					rs.close();
				}
				if(pstmt != null) {
					pstmt.close();
				}
				if(conn != null) {
					conn.close();
				}
			} catch (SQLException e) {
				e.printStackTrace();
				throw new StorageException(e.getMessage());
			}
		}
	    
	    return users;
	}