pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: rob stone <floriparob@gmail.com>
Cc: Karen Goh <karenworld@yahoo.com>
Cc: pgsql-jdbc@lists.postgresql.org, 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: Wed, 4 Sep 2019 10:39:09 -0600
Message-ID: <1EC7278E-6842-4269-BCED-4238EFFF6562@gmail.com> (raw)
In-Reply-To: <9b008bfa3107e8a3f7505b6f300237d1e13eff7f.camel@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>


> 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. =

view thread (21+ messages)  latest in thread

Message-ID: <1EC7278E-6842-4269-BCED-4238EFFF6562@gmail.com>
Permalink:  ../1EC7278E-6842-4269-BCED-4238EFFF6562@gmail.com/
Also on:    postgresql.org/message-id/1EC7278E-6842-4269-BCED-4238EFFF6562@gmail.com

 · 

reply

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: robjsargent@gmail.com, floriparob@gmail.com, karenworld@yahoo.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: <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>

* 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