| От | Graham Leggett |
|---|---|
| Тема | NullPointerException inside ResultSet.next() |
| Дата | |
| Msg-id | 3C704065.AAF045A4@sharp.fm обсуждение исходный текст |
| Ответы |
Re: NullPointerException inside ResultSet.next()
|
| Список | pgsql-jdbc |
Hi all,
I have a query which returns multiple rows like so:
ResultSet ingredients = st.executeQuery("SELECT * FROM ingredientslookup
WHERE (recipeindex = " + recipes.getInt("recipe_index") + ")");
while (ingredients.next()) {
// do stuff
}
When I run this query, it iterates through the while loop exactly once,
but then bombs out on the second attempt to evaluate
"ingedients.next()".
java.lang.NullPointerException
at org.postgresql.jdbc2.ResultSet.next(ResultSet.java:113)
My question is: Should it be possible for this exception to occur inside
this code at all?
Am I making a mistake somewhere, or is this a bug in the jdbc driver?
I have tried both the driver that came with v7.1.3, and the latest v7.2
driver from jdbc.postgresql.org.
Regards,
Graham
--
-----------------------------------------
minfrin@sharp.fm "There's a moon
over Bourbon Street
tonight..."
В списке pgsql-jdbc по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера