public void updateRoom(Room room)
	{
		try {
			PreparedStatement ps;
			
			if(room.getId() > 0) // UPDATE existing room.
			{
				ps = con.prepareStatement("UPDATE rooms SET name=?, value=?," +
						" capacity=?, group_id=? WHERE id=? ");
				ps.setInt(5, room.getId());
			}
			else // INSERT a new room.
			{
				ps = con.prepareStatement("INSERT INTO rooms (name, value," +
						" capacity, group_id) VALUES (?, ?, ?, ?, ?)");
			}
			ps.setString(1, room.getName());
			ps.setInt(2, room.getValue());
			ps.setInt(3, room.getCapacity());
			ps.setInt(4, room.getGroupId());
			ps.executeUpdate();
			ps.close();
			
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}