From: Karen Goh <karenworld@yahoo.com>
To: Rob Sargent <robjsargent@gmail.com>
To: rob stone <floriparob@gmail.com>
Cc: pgsql-jdbc@lists.postgresql.org
Cc: Mark Rotteveel <mark@lawinegevaar.nl>
Subject: Re: how to resolve org.postgresql.util.PSQLException: ResultSet not positioned properly, perhaps you need to call next.
Date: Thu, 5 Sep 2019 01:48:29 +0000 (UTC)
Message-ID: <522221901.1676873.1567648109451@mail.yahoo.com> (raw)
In-Reply-To: <1EC7278E-6842-4269-BCED-4238EFFF6562@gmail.com>
References: <932079842.712590.1567405714491@mail.yahoo.com>
<58285538-686D-45F6-B5A5-883DBE7D0C10@gmail.com>
<1422030722.958511.1567487705474@mail.yahoo.com>
<1ACDE5B3-3F0E-4BF0-8C37-DAD09F35F30C@gmail.com>
<860006402.1322813.1567568281784@mail.yahoo.com>
<B3FFC2E6-0BBC-41F5-863B-396417CB0FDF@gmail.com>
<1829430979.1362196.1567576711470@mail.yahoo.com>
<8b79560c-3108-af04-e74f-f4fb55aa0624@lawinegevaar.nl>
<1705600642.1365952.1567582413285@mail.yahoo.com>
<9b008bfa3107e8a3f7505b6f300237d1e13eff7f.camel@gmail.com>
<1EC7278E-6842-4269-BCED-4238EFFF6562@gmail.com>
Not at all. As mentioned, I could print out the queried subectNames, at the ide and at the database. But, I can’t anymore.
However, I need to deal with Tomcat problem first to give me a real reflection of my code error.
Sent from Yahoo Mail for iPhone
On Thursday, September 5, 2019, 12:39 AM, Rob Sargent <robjsargent@gmail.com> wrote:
As I said last time, I'm not an "expert".
subjectNames is declared as an array.
In your "for" loop you will be doing ps2.setArray(2, array); multiple
times depending on the number of subjects contained in subjectNames.
I suspect the query is failing and as there is no try .. catch block to
trap the SQLException, this is not reported back to your code.
If you alter the postgresql.conf to log all SQL statements, restart,
run your test again, look in the log file, it will show the passed
parameter values. You can then verify that that the array passed as the
second parameter is correct.
HTH,
Robert
Relieved am I that other’s could see that I was not doubting the OP wrote the code in question. I do consider myself a Java programmer (expert is a trickier question).
We do need to see the entire routine (I think that might be doPost()). If that’s more than 100 lines I suggest a refactor first. Have the doPost() call a method which does nothing but the desired interaction.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: karenworld@yahoo.com, robjsargent@gmail.com, floriparob@gmail.com, mark@lawinegevaar.nl
Subject: Re: how to resolve org.postgresql.util.PSQLException: ResultSet not positioned properly, perhaps you need to call next.
In-Reply-To: <522221901.1676873.1567648109451@mail.yahoo.com>
References: <932079842.712590.1567405714491@mail.yahoo.com> <58285538-686D-45F6-B5A5-883DBE7D0C10@gmail.com> <1422030722.958511.1567487705474@mail.yahoo.com> <1ACDE5B3-3F0E-4BF0-8C37-DAD09F35F30C@gmail.com> <860006402.1322813.1567568281784@mail.yahoo.com> <B3FFC2E6-0BBC-41F5-863B-396417CB0FDF@gmail.com> <1829430979.1362196.1567576711470@mail.yahoo.com> <8b79560c-3108-af04-e74f-f4fb55aa0624@lawinegevaar.nl> <1705600642.1365952.1567582413285@mail.yahoo.com> <9b008bfa3107e8a3f7505b6f300237d1e13eff7f.camel@gmail.com> <1EC7278E-6842-4269-BCED-4238EFFF6562@gmail.com> <522221901.1676873.1567648109451@mail.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox