Hi all..
I having problems to make some queries and I can't think anymore about what could be...
I understand that I will get a 'invalid cursor state' if I try to get some data from a empty ResultSet... but I'm receiving this error when I make the query...
Please, friends, take a look in my code and tell me what I'm doing wrong... please..
Thank you.
Fl�vio Henrique
this is a JButton's actionPerformed :
ResultSet rs, rs2;
String evento = "", local= "", periodoInicial= "", periodoFinal= "";
if ( diaRepasse.getText().trim().length() > 0 ) {
try {
Statement st = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
Statement st2 = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
rs = st.executeQuery(UtilDB.buscaEventosPorDiaRepasse(Integer.parseInt(diaRepasse.getText().trim())));
while (rs.next()){
evento = rs.getString("c�digo");
local = rs.getString("local");
rs2 = st2.executeQuery(UtilDB.selecionaTitulosBaixados(evento, local));
}
}
catch (Exception e){
UtilDB.errosg(e);
}
}
The error occurs in :
rs2 = st2.executeQuery(UtilDB.selecionaTitulosBaixados(evento, local));
if the line above returnn nothing, I got the error, if returns records no problem...
the odd thing is: if the same occurs (returns nothing0 in the first executeQuery I do not get the error...
I dont think that methods "UtilDB.buscaEventosPorDiaRepasse(Integer.parseInt(diaRepasse.getText().trim()))" and "UtilDB.selecionaTitulosBaixados(evento, local)" is not necessary to post here, because they just returns a sql command.
Thank you in advance for ANY help/tip.
Fl�vio Henrique