Re: Moving from PHP to Java: A result was returned when none was expected.

From: Jan de Visser <jan(at)de-visser(dot)net>
To: pgsql-general(at)postgresql(dot)org
Cc: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
Subject: Re: Moving from PHP to Java: A result was returned when none was expected.
Date: 2016-06-15 14:17:24
Message-ID: 2349408.aGKHqv254v@coyote
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wednesday, June 15, 2016 3:56:07 PM EDT Alexander Farber wrote:
> Now I am trying to call the same function through JDBC driver 9.4.1208.jre7:
>
> private static final String SQL_SKIP_GAME =
> "SELECT words_skip_game(?, ?)";
>
> try (PreparedStatement st =
> mDatabase.prepareStatement(SQL_SKIP_GAME)) { st.setInt(1, mUid);
> st.setInt(2, gid);
> st.executeUpdate();
> }
>
> and sadly get the SQLException "A result was returned when none was
> expected.".
>
> Shouldn't I call executeUpdate() method here - according to the doc
> https://www.postgresql.org/docs/7.4/static/jdbc-callproc.html ?

You are looking at the 7.4 documentation. That page is so old it can apply for
a driver's license in some jurisdictions.

Looking at the 9.4 documentation, I see something completely different:

https://jdbc.postgresql.org/documentation/94/callproc.html

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Farber 2016-06-15 14:21:47 Re: Moving from PHP to Java: A result was returned when none was expected.
Previous Message David G. Johnston 2016-06-15 14:03:35 Re: Changelog version from 8.1.2 to 9.3.6