BenJDBC tek sıra resultset erişim hatası
Product | Process | s_int
--------------------------
W01 | AP_03 | 1
ben sonuç kümesini (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());
bu hatayı alıyorum kullanıyorum verilere erişmek için aşağıdaki gibi tek satır sorgu çıkış Loks var :
The result set has no current row and the returns are null and 0.
Neyi yanlış yapıyorum? ResultSet
erişmeye çalışmadan önce
true
if the cursor is on a valid row;false
if there are no rows in the result set
Kontrol bu: Bir satır veya değil açıksa
sen https://docs.oracle.com/javase/8/docs, (bkz bir 'if' ile)' ilk() 'çağrısının sonucunu kontrol etmek gerek /api/java/sql/ResultSet.html#first() Kolay yolu, bir süreliğine bir süre burada değiştirmektir. –
, 'next()' ** önce ** çağırmanız gerekir. Kodunuz bunu _after_ bu –