public String getMaxAgentId() {
			
			String maxAgentId="";
			
			try {
				rs = stmt.executeQuery("SELECT MAX(agentid) FROM agents");
				while (rs.next())
				{
					
					maxAgentId = rs.getString(1);
					
				}
			} catch (SQLException e) {
				
				e.printStackTrace();
			}
			return maxAgentId;//the method returns an instance of agent
		}