Javaでストアプロシージャを実行しています。プロシージャの 1 つが複数の行を返します。
int haveResults = Param.callableStatement.executeUpdate();
System.out.println(haveResults);
if (haveResults > 0) {
System.out.println("I have results"); //This statement is printed
ResultSet rs = Param.callableStatement.getResultSet();
while (rs.next()) { //This is where I am getting error:NullPointerException
//If I comment 'while(rs.next())' then code is giving output but then it can't handle multiple rows
itr1 = listOutParam.iterator();
while (itr1.hasNext()) {
Object obj = null;
obj = ParameterGetter.getParameter(itr1.next().toString(), counter1);
list.add(obj);
counter1++;
}
System.out.println(list.toString());
list1.add(list);
counter1 = counter2;
}
}
}
execute() を使用してみましたが、プロシージャが正常に実行されていないことを示す false 値を返す場合。