Tentando de outra forma inserir dados na minha tabela.
Eis o método:
public void inserirRegistro() {
String titulo = "Inserindo novo registro...";
String id = JOptionPane.showInputDialog(null, "Digite ID do cliente:", titulo, 3);
String nome = JOptionPane.showInputDialog(null, "Digite o nome do cliente", titulo, 3);
String telefone = JOptionPane.showInputDialog(null, "Digite o telefone do cliente", titulo, 3);
try {
sentenca = conexao.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
resultadoConsulta = sentenca.executeQuery("SELECT id_cliente, nome_cliente, telefone_cliente FROM CLIENTES");
resultadoConsulta.moveToInsertRow();
resultadoConsulta.updateInt("id_cliente", id);
resultadoConsulta.updateString("nome_cliente", nome);
resultadoConsulta.updateString("telefone_cliente", telefone);
resultadoConsulta.insertRow();
}
catch(SQLException s) { s.printStackTrace(); }
}
Acontece algo estranho. Na linha updateInt() aparece a mensagem de erro:
Cannot find simbol
method : updateInt() …
interface : java.sql.Result
E se eu apago a linha updateInt() e executo o programa só para testar, outro erro, talvez pior ainda ocorre:
java.sql.SQLException: This function is not supported
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.Util.notSupported(Unknown Source)
at org.hsqldb.jdbc.jdbcResultSet.moveToInsertRow(Unknown Source)
O que está ocorrendo? Preciso corrigir essas falhas urgentes, tenho um trabalho a fazer sobre HSQLDB!
Obrigado!