public void insertAgent(Agent agent)
	{
		int numRows;
		int agentId = 0;
		
		try {
			rs = stmt.executeQuery("SELECT MAX(agentid) maxid FROM agents");//select max agentid from DB
			while (rs.next())
			{
				agentId = rs.getInt("maxid");
			}
		} catch (SQLException e1) {
			e1.printStackTrace();
		}
		agentId = agentId + 1;//increment agent id by 1
		
		//System.out.println("Agent id is:"+agentId);
		
		//insert sql statement constructed
        String sql = "INSERT INTO agents VALUES( "
        	+ agentId
        	+ ", '" + agent.getAgentFirstName()
        	+"', '" + agent.getAgentMI()
        	+"', '" + agent.getAgentLastName()
        	+"', '" + agent.getAgentPhone()
        	+"', '" + agent.getAgentEmail()
        	+"', '" + agent.getAgentPosition()
        	+"', '"+ agent.getAgencyId()
        	+"')";
        	
        //System.out.println(sql);
        try 
        {
        	PreparedStatement preparedStatement = conn.prepareStatement(sql);
        	
        	// execute update SQL statement
        	numRows =  preparedStatement.executeUpdate();
        	if (numRows == 0)
        	{
        		System.out.println("insert failed");
        	}
        	else
        	{
        		System.out.println("insert " + numRows + " row(s)");
        		conn.commit();
        	}
        } catch (SQLException e) {
			e.printStackTrace();
		}         	
        
	}