private int inserir (Endereco e){
        int status = -1;
        Connection con = null;
        PreparedStatement pstm = null;
        
        try{
           con = ConnectionFactory.getConnection();
           pstm = con.prepareStatement(INSERT, Statement.RETURN_GENERATED_KEYS);
           
           pstm.setString(1, e.getEstado());
           pstm.setString(2, e.getCidade());
           pstm.setString(3, e.getBairro());
           pstm.setString(4, e.getRua());
           pstm.setString(5, e.getComplemento());
           pstm.setInt(6, e.getNumero());
           pstm.execute();
           
           try(ResultSet rs = pstm.getGeneratedKeys()){
               rs.next();
               status = rs.getInt(1);
           }
        } catch (Exception ex){
            JOptionPane.showMessageDialog(null, "Erro ao inserir endereço: " + ex.getMessage());
        } finally{
            try{
                ConnectionFactory.closeConnection(con, pstm);
            } catch(Exception ex){
                JOptionPane.showMessageDialog(null, "Erro ao fechar conexão: " + ex.getMessage());
            }
        }
        
        return status;
    }