Conversion error

Asked

Viewed 29 times

0

I’m trying to update a schedule through Jtable. But when I try to update it gives an error

java.sql.Sqldataexception: data Exception: invalid Character value for cast

private class BtEditarListener implements ActionListener {

        public void actionPerformed(ActionEvent e) {
            int linhaSelecionada = -1;
            linhaSelecionada = tabela.getSelectedRow();
            if (linhaSelecionada >= 0) {
                int idContato = (Integer) tabela.getValueAt(linhaSelecionada, 0);
                AtualizarContato ic = new AtualizarContato(modelo, idContato, linhaSelecionada);
                ic.setVisible(true);
            } else {
                JOptionPane.showMessageDialog(null, "É necessário selecionar uma linha.");
            }
        }
    }

How do I get to carry out the conversation to update.

Can the error be caused by the bank account? Or the Java version? The computer uses Access and Java is in 1.6

1 answer

0

Flávia Bruna, please post the stack trace of the error. The way you put it seems to be here the error:

int idContato = (Integer) tabela.getValueAt(linhaSelecionada, 0);

However, apparently there is nothing abnormal there since the method returns an Objetc and really needs a cast. So the idea would be to post the stack trace.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.