I have a single row query output loks like below
Product | Process | s_int
--------------------------
W01 | AP_03 | 1
To access the data I am using result set (rSet)
rSet.first();
do{
product = rSet.getString("PRODUCT");
process = rSet.getString("PROCESS");
s_int = rSet.getInt("S_INT");
System.out.println("Hello Product["+rSet.getString("PRODUCT")+"] Process["+rSet.getString("PROCESS")+"] S_Int["+rSet.getInt("sint")+"]");
}while(rSet.next());
I am getting this error:
The result set has no current row and the returns are null and 0.
What I am doing wrong?
first()
call (with anif
), see docs.oracle.com/javase/8/docs/api/java/sql/… The easy way is to replace the do / while by a while herenext()
before you access the data. Your code calls it after that