I have the following problem:
I need to set a boolean true is an entry in a database exists.
ResultSet rc1 = null;
int Counterval;
String url = "jdbc:db2://localhost:50000/dbname";
Connection conn = DriverManager.getConnection(url,"","");
Statement st = conn.createStatement();
String sqlmd="select count(*) as Counter from tablename where mdsum = '"+mdSum+"' and filename = '"+Filename+"'";
rc1=st.executeQuery(sqlmd);
Counterval=rc1.getInt("Counter");
System.out.println("VAL: "+Counterval);
conn.close();
I get the following error message:
[jcc][t4][1090][10899][4.19.26] Illigal operation to read at the current cursor position. ERRORCODE=-4476, SQLSTATE=02501
How can I do this? I use DB2 if that is of importance
Thanks for your help in advance.
TheVagabond