Re: jdbc problem

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Raivo Rebane <raivore55(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: jdbc problem
Date: 2023-09-24 18:18:58
Message-ID: 7ca26afdae05821f11aaedecb48f0efde052c501.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, 2023-09-24 at 20:33 +0300, Raivo Rebane wrote:
> I hav postgresql 15 installed in my windows computer.
>
> I have maven java project, wich works temporarly in Eclipse, but mvn install did'nt work.
>
> Now it works, but I have got error -
>
> Exception in thread "main" java.lang.NoSuchMethodError: 'org.postgresql.core.Encoding org.postgresql.core.BaseConnection.getEncoding()'
>          at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:1889)
>          at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getTimestamp(AbstractJdbc2ResultSet.java:438)
>          at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getTimestamp(AbstractJdbc2ResultSet.java:2406)
>          at backendproject.BackendMain.main(BackendMain.java:64)
>
> backendproject.BackendMain.main(BackendMain.java:64) line is following -
>
> Timestamp oldest_timestamp = resultSet.getTimestamp("oldest_timestamp");
>
> Query from Java is following -
>
>             String query = "SELECT timestamp AS oldest_timestamp FROM mushrooms";
>             PreparedStatement statement = connection.prepareStatement(query);
>             ResultSet resultSet = statement.executeQuery();

You should ask the JDBC driver mailing list.

As a first measure, try upgrading to 42.6.0 and see if the error persists.

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2023-09-24 23:53:31 Re: Question regarding specifics of GIN and pg_trgm performance and potential use of show_trgm to improve it
Previous Message postgresql439848 2023-09-24 18:10:09 Re: jdbc problem