Estou com o seguinte problema: na parte do código abaixo quando compilo retorna o seguinte erro: operation not allowed after resultset closed. Já vi alguns tópicos referentes a esse erro mas não consegui corrigí-lo. Se alguém puder me ajudar ficarei muito grato. Obrigado.
public void inserir(JFormattedTextField data, JComboBox cbIdentProjetor, JFormattedTextField
txtHrInicio,JFormattedTextField txtHrTermino, ButtonGroup radioGrupoCateg, JTextField
txtNome,ButtonGroup radioGrupoEvent, JTextField txtEspecificar, JTextArea jtxObs,
JComboBox cbProf, JComboBox cbDisc){
connection.conectar();
try{
connection.executeSQL("SELECT * FROM reserva_projetor");
connection.stm.executeQuery("SELECT data, hora_inicio, hora_termino FROM reserva_projetor");
//System.out.println("TESTEEE-------: " + connection.rs.getString("data"));
while(connection.rs.next()){
if(connection.rs.getString("data").equals(data.getText()) && connection.rs.getString("hora_inicio").equals(txtHrInicio.getText())
&& connection.rs.getString("hora_termino").equals(txtHrTermino.getText())){
JOptionPane.showMessageDialog(null, "Reserva já existente!");
}else{
int indentProjetor = cbIdentProjetor.getSelectedIndex()+1;
if(radioGrupoCateg.getSelection().getActionCommand() == "Aluno" ||
radioGrupoCateg.getSelection().getActionCommand() == "Funcionário" &&
radioGrupoEvent.getSelection().getActionCommand() == "Curso" ||
radioGrupoEvent.getSelection().getActionCommand() == "Outros"){
connection.stm.executeUpdate("INSERT INTO reserva_projetor " +
"(projetor, data, hora_inicio, hora_termino, requisitante, nome_requisitante, evento, " +
"nome_evento, observacao) VALUES('"+indentProjetor+"','"+ data.getText() + "','"+
txtHrInicio.getText()+"','"+txtHrTermino.getText()+"', '"+radioGrupoCateg.getSelection().getActionCommand()
+"','"+ txtNome.getText()+"','"+radioGrupoEvent.getSelection().getActionCommand()+"','"+
txtEspecificar.getText()+"','"+jtxObs.getText()+"')");
}else{
connection.stm.executeUpdate("INSERT INTO reserva_projetor (projetor, data, hora_inicio, " +
"hora_termino, requisitante, nome_requisitante, evento, nome_evento, observacao) " +
"VALUES ('"+indentProjetor+"','"+data.getText()+ "','"+txtHrInicio.getText()+"','"+
txtHrTermino.getText()+"','"+radioGrupoCateg.getSelection().getActionCommand()
+"','"+cbProf.getSelectedItem()+"','"+radioGrupoEvent.getSelection().getActionCommand()+"','"+
cbDisc.getSelectedItem()+"','"+jtxObs.getText()+"')");
}
}
}
}catch (SQLException e) {
JOptionPane.showMessageDialog(data, this,"Erro no comando SQL "+ e.getMessage(), 0);
}finally{
connection.desconectar();
}
}

