Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i5OKa-0004Sh-41 for pgsql-jdbc@arkaria.postgresql.org; Wed, 04 Sep 2019 05:59:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i5OJZ-00021r-5r for pgsql-jdbc@arkaria.postgresql.org; Wed, 04 Sep 2019 05:58:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i5OJY-0001vp-J8 for pgsql-jdbc@lists.postgresql.org; Wed, 04 Sep 2019 05:58:44 +0000 Received: from sonic309-22.consmr.mail.ne1.yahoo.com ([66.163.184.148]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i5OJR-0000TY-6e for pgsql-jdbc@lists.postgresql.org; Wed, 04 Sep 2019 05:58:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1567576714; bh=IDhTj0z/uuaajyitNb2aNmJixlOol8o7VIuuxTC8H/s=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject; b=mp1/GX9e1gJsJJVvwbCsnFqU+y5fKBMeFQcqLjqz3vuV/eGa0JG6MQ7Eaeq/LPH2QNapIZIZwqf1vdgUROglXD4d/9wF5GJcIe3l2z3bIlzJ/GH6gMUNBIOKpFFK9wnUS5Xm0wI07ghfnQEzBSa2UpJRsyo6tLrYn5JvuS+C+FYwajm4mVxPatL7ckuwckBfCwEwRou77sXXWYPLQQ4khtDdKMUSj6e60NbDS93GXU34PfRaki5JJ9YVmnhaPYa25Tjkg3NOpXKAf+X4yJpNQadtm6/aGf9SN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Rj3YSJ3ZXSRWA6Gk86X4.9zEnG2ZiEEp.p62j4O6Yp6bZzo3UGMqAXb9lw SKeMkzsQ90wDfJ02.JuLrTEqC7HNLi7R1aUEDtKw.N2XUQKLcSCKtpL6Ik1H_snEgMEZZmHT48SB GF217POqWG9fL9r1ogn5DiFRIYY_9V.QeYyp3q1Co5ZmkG79.1J_C1yQhJub9LWeSgFzZtY1VDNw XK4h9mhxMPuF6l4b_4mTCzUwfLZ5.NMVrZ8DEJduqvJZ4qBnGYVB_Rp6Cok3wsunQEUv6TkEvWFz SDSncomjU0RmxjhcmWRZar0TU7bP2dPijfStSD_WlDr64OROffVTfZXr3MntZXA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ne1.yahoo.com with HTTP; Wed, 4 Sep 2019 05:58:34 +0000 Date: Wed, 4 Sep 2019 05:58:31 +0000 (UTC) From: Karen Goh To: Rob Sargent Cc: pgsql-jdbc@lists.postgresql.org Message-ID: <1829430979.1362196.1567576711470@mail.yahoo.com> In-Reply-To: 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> Subject: Re: how to resolve org.postgresql.util.PSQLException: ResultSet not positioned properly, perhaps you need to call next. MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1362195_11918842.1567576711468" Content-Length: 11684 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_1362195_11918842.1567576711468 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Rob, I find the way you asked me if it is my code very strange and why would you= say it is not my code, and I have been fighting every minute to resolve th= is and my head is pain with all these error ! If you can't help me, the least you can is to own up you don't have the ans= wer or refrain from saying something that is not RIGHT. Thanks=20 On Wednesday, September 4, 2019, 1:13:15 PM GMT+8, Rob Sargent wrote: =20 =20 =20 > On Sep 3, 2019, at 9:38 PM, Karen Goh wrote: >=20 > Sure. > I tried various ways to see if there is any mistakes. Still, I get the sa= me old error :( >=20 > Very difficult to type in Yahoo mail now...so I am continuing here (after= you read the last sentence of the mail) >=20 > So, even if I remove the System.out.print...it still gives me the error..= . >=20 > Could it be Tomcat problem ? because I remove the page forwarded lines al= l altogether and it gave me the same old error as per not positioned proper= ly, blah ... >=20 > org.postgresql.util.PSQLException: ResultSet not positioned properly, per= haps you need to call next. > at org.postgresql.jdbc.PgResultSet.checkResultSet(PgResultSet.java:2772) > at org.postgresql.jdbc.PgResultSet.getInt(PgResultSet.java:2052) > at org.postgresql.jdbc.PgResultSet.getInt(PgResultSet.java:2485) > at Controller.searchController.doPost(searchController.java:117) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli= cationFilterChain.java:231) > at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi= lterChain.java:166) > at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli= cationFilterChain.java:193) > at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi= lterChain.java:166) > at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletF= ilter.java:71) > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli= cationFilterChain.java:193) > at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi= lterChain.java:166) > at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVa= lve.java:202) > at org.apache.catalina.core.StandardContextValve.invoke(StandardContextVa= lve.java:96) > at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticat= orBase.java:526) > at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.ja= va:139) > at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.ja= va:92) > at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAcces= sLogValve.java:678) > at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValv= e.java:74) > at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java= :343) > at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:= 408) > at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLigh= t.java:66) > at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractP= rotocol.java:860) > at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoi= nt.java:1587) > at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase= .java:49) > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.j= ava:1149) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.= java:624) > at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThr= ead.java:61) > at java.lang.Thread.run(Thread.java:748) >=20 > And below the line that is giving problem : > subjList.add(rs.getString("subject_name")); > newSub.addAll(subjList); >=20 > System.out.println( "tutor ID=3D" + rs.getInt("tutor_id") + "zipcode =3D"= + rs.getString("zipcode") + > "subjectName=3D" + rs.getString("subject_name") + "tutorContact=3D" + > rs.getString("tutor_contact_no"));=20 > }} > I now inserted it before the close bracket of resultset. >=20 > It points to System.out.print >=20 Is "Controller.searchController.doPost(searchController.java:117)=E2=80=9D = your code?=C2=A0 Do you in fact call rs.next() appropriately? Also unless there=E2=80=99s a subjList =3D new List<> (or subjList.clear())= somewhere nearby you may be adding the contents of subjList more than once= .=C2=A0 There=E2=80=99s not enough of your code here to tell for sure exact= ly what=E2=80=99s going on. =20 ------=_Part_1362195_11918842.1567576711468 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Rob,

I find the way you asked me if it is my= code very strange and why would you say it is not my code, and I have been= fighting every minute to resolve this and my head is pain with all these e= rror !

If you can't help me, the least you can is to own up you = don't have the answer or refrain from saying something that is not RIGH= T.

Thanks