Right version of jdbc

Started by Raivo Rebaneover 2 years ago37 messagesgeneral
Jump to latest
#1Raivo Rebane
raivore55@gmail.com

Hi,
I use :
PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
and
PostGIS 3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1

What versions of jdbc driver I have to use for proper work ?

Regards,
Raivo

#2Thomas Kellerer
shammat@gmx.net
In reply to: Raivo Rebane (#1)
Re: Right version of jdbc

Raivo Rebane schrieb am 25.09.2023 um 10:36:

I use :
  PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
and
PostGIS  3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1

What versions of jdbc driver I have to use for proper work ?

Use the latest, i.e. 42.6.0

#3Dave Cramer
pg@fastcrypt.com
In reply to: Raivo Rebane (#1)
Re: Right version of jdbc

Hi,

The latest version of the driver is usually the right answer. So 42.5.4
Dave Cramer
www.postgres.rocks

On Mon, 25 Sept 2023 at 07:03, Raivo Rebane <raivore55@gmail.com> wrote:

Show quoted text

Hi,
I use :
PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
and
PostGIS 3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1

What versions of jdbc driver I have to use for proper work ?

Regards,
Raivo

#4Dave Cramer
pg@fastcrypt.com
In reply to: Dave Cramer (#3)
Re: Right version of jdbc

Sorry 42.6.0

Interesting that github still has 42.5.4 as the release

Dave Cramer
www.postgres.rocks

On Mon, 25 Sept 2023 at 07:27, Dave Cramer <davecramer@postgres.rocks>
wrote:

Show quoted text

Hi,

The latest version of the driver is usually the right answer. So 42.5.4
Dave Cramer
www.postgres.rocks

On Mon, 25 Sept 2023 at 07:03, Raivo Rebane <raivore55@gmail.com> wrote:

Hi,
I use :
PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
and
PostGIS 3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1

What versions of jdbc driver I have to use for proper work ?

Regards,
Raivo

#5Raivo Rebane
raivore55@gmail.com
In reply to: Dave Cramer (#4)
Re: Right version of jdbc

Hi,
now I using following -
[INFO] Copying postgis-jdbc-2.1.7.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgis-jdbc-2.1.7.jar
[INFO] Copying postgresql-42.6.0.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgresql-42.6.0.jar
[INFO] Copying checker-qual-3.31.0.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\checker-qual-3.31.0.jar
but on executions I got -
Exception in thread "main" java.lang.NoClassDefFoundError:
org/postgis/PGgeometry
at
backendproject.ProcQueryMushrooms.ProcQuery(ProcQueryMushrooms.java:41)
at backendproject.BackendMain.main(BackendMain.java:81)
Caused by: java.lang.ClassNotFoundException: org.postgis.PGgeometry
at
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)

What I have to do ?

I use following -
PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
PostGIS 3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
Regards
Raivo

On Mon, Sep 25, 2023 at 2:29 PM Dave Cramer <davecramer@postgres.rocks>
wrote:

Show quoted text

Sorry 42.6.0

Interesting that github still has 42.5.4 as the release

Dave Cramer
www.postgres.rocks

On Mon, 25 Sept 2023 at 07:27, Dave Cramer <davecramer@postgres.rocks>
wrote:

Hi,

The latest version of the driver is usually the right answer. So 42.5.4
Dave Cramer
www.postgres.rocks

On Mon, 25 Sept 2023 at 07:03, Raivo Rebane <raivore55@gmail.com> wrote:

Hi,
I use :
PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
and
PostGIS 3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1

What versions of jdbc driver I have to use for proper work ?

Regards,
Raivo

#6Dave Cramer
pg@fastcrypt.com
In reply to: Raivo Rebane (#5)
Re: Right version of jdbc

The missing class is from the postgis jar. Are you sure it is on your
classpath ?

Dave Cramer
www.postgres.rocks

On Mon, 25 Sept 2023 at 08:26, Raivo Rebane <raivore55@gmail.com> wrote:

Show quoted text

Hi,
now I using following -
[INFO] Copying postgis-jdbc-2.1.7.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgis-jdbc-2.1.7.jar
[INFO] Copying postgresql-42.6.0.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgresql-42.6.0.jar
[INFO] Copying checker-qual-3.31.0.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\checker-qual-3.31.0.jar
but on executions I got -
Exception in thread "main" java.lang.NoClassDefFoundError:
org/postgis/PGgeometry
at
backendproject.ProcQueryMushrooms.ProcQuery(ProcQueryMushrooms.java:41)
at backendproject.BackendMain.main(BackendMain.java:81)
Caused by: java.lang.ClassNotFoundException: org.postgis.PGgeometry
at
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)

What I have to do ?

I use following -
PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
PostGIS 3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
Regards
Raivo

On Mon, Sep 25, 2023 at 2:29 PM Dave Cramer <davecramer@postgres.rocks>
wrote:

Sorry 42.6.0

Interesting that github still has 42.5.4 as the release

Dave Cramer
www.postgres.rocks

On Mon, 25 Sept 2023 at 07:27, Dave Cramer <davecramer@postgres.rocks>
wrote:

Hi,

The latest version of the driver is usually the right answer. So 42.5.4
Dave Cramer
www.postgres.rocks

On Mon, 25 Sept 2023 at 07:03, Raivo Rebane <raivore55@gmail.com> wrote:

Hi,
I use :
PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
and
PostGIS 3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1

What versions of jdbc driver I have to use for proper work ?

Regards,
Raivo

#7Raivo Rebane
raivore55@gmail.com
In reply to: Raivo Rebane (#5)
Re: Right version of jdbc

Hi, now I use -
<dependencies>
<dependency>
<groupId>org.postgis</groupId>
<artifactId>postgis-jdbc</artifactId>
<version>1.3.3</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.5.4</version> <!-- Kasuta kõige uuemat versiooni -->
</dependency>
</dependencies>
But I 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)

Whats wrong ?

Raivo

On Mon, Sep 25, 2023 at 3:26 PM Raivo Rebane <raivore55@gmail.com> wrote:

Show quoted text

Hi,
now I using following -
[INFO] Copying postgis-jdbc-2.1.7.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgis-jdbc-2.1.7.jar
[INFO] Copying postgresql-42.6.0.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgresql-42.6.0.jar
[INFO] Copying checker-qual-3.31.0.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\checker-qual-3.31.0.jar
but on executions I got -
Exception in thread "main" java.lang.NoClassDefFoundError:
org/postgis/PGgeometry
at
backendproject.ProcQueryMushrooms.ProcQuery(ProcQueryMushrooms.java:41)
at backendproject.BackendMain.main(BackendMain.java:81)
Caused by: java.lang.ClassNotFoundException: org.postgis.PGgeometry
at
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)

What I have to do ?

I use following -
PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
PostGIS 3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
Regards
Raivo

On Mon, Sep 25, 2023 at 2:29 PM Dave Cramer <davecramer@postgres.rocks>
wrote:

Sorry 42.6.0

Interesting that github still has 42.5.4 as the release

Dave Cramer
www.postgres.rocks

On Mon, 25 Sept 2023 at 07:27, Dave Cramer <davecramer@postgres.rocks>
wrote:

Hi,

The latest version of the driver is usually the right answer. So 42.5.4
Dave Cramer
www.postgres.rocks

On Mon, 25 Sept 2023 at 07:03, Raivo Rebane <raivore55@gmail.com> wrote:

Hi,
I use :
PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
and
PostGIS 3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1

What versions of jdbc driver I have to use for proper work ?

Regards,
Raivo

#8Raivo Rebane
raivore55@gmail.com
In reply to: Raivo Rebane (#7)
Re: Right version of jdbc

And target/lib is s following :
Directory of C:\Users\Raivo\eclipse-workspace\backendproject\target\lib

25.09.2023 15:35 <DIR> .
25.09.2023 15:33 <DIR> ..
25.09.2023 15:33 214 381 checker-qual-3.5.0.jar
25.09.2023 13:14 75 847 postgis-jdbc-1.3.3.jar
25.09.2023 13:14 2 833 postgis-stubs-1.3.3.jar
25.09.2023 15:33 1 049 651 postgresql-42.5.4.jar
25.09.2023 13:14 474 746 postgresql-8.3-603.jdbc4.jar

Raivo

On Mon, Sep 25, 2023 at 3:38 PM Raivo Rebane <raivore55@gmail.com> wrote:

Show quoted text

Hi, now I use -
<dependencies>
<dependency>
<groupId>org.postgis</groupId>
<artifactId>postgis-jdbc</artifactId>
<version>1.3.3</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.5.4</version> <!-- Kasuta kõige uuemat versiooni -->
</dependency>
</dependencies>
But I 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)

Whats wrong ?

Raivo

On Mon, Sep 25, 2023 at 3:26 PM Raivo Rebane <raivore55@gmail.com> wrote:

Hi,
now I using following -
[INFO] Copying postgis-jdbc-2.1.7.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgis-jdbc-2.1.7.jar
[INFO] Copying postgresql-42.6.0.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgresql-42.6.0.jar
[INFO] Copying checker-qual-3.31.0.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\checker-qual-3.31.0.jar
but on executions I got -
Exception in thread "main" java.lang.NoClassDefFoundError:
org/postgis/PGgeometry
at
backendproject.ProcQueryMushrooms.ProcQuery(ProcQueryMushrooms.java:41)
at backendproject.BackendMain.main(BackendMain.java:81)
Caused by: java.lang.ClassNotFoundException: org.postgis.PGgeometry
at
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)

What I have to do ?

I use following -
PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
PostGIS 3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
Regards
Raivo

On Mon, Sep 25, 2023 at 2:29 PM Dave Cramer <davecramer@postgres.rocks>
wrote:

Sorry 42.6.0

Interesting that github still has 42.5.4 as the release

Dave Cramer
www.postgres.rocks

On Mon, 25 Sept 2023 at 07:27, Dave Cramer <davecramer@postgres.rocks>
wrote:

Hi,

The latest version of the driver is usually the right answer. So 42.5.4
Dave Cramer
www.postgres.rocks

On Mon, 25 Sept 2023 at 07:03, Raivo Rebane <raivore55@gmail.com>
wrote:

Hi,
I use :
PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
and
PostGIS 3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1

What versions of jdbc driver I have to use for proper work ?

Regards,
Raivo

#9Dave Cramer
pg@fastcrypt.com
In reply to: Raivo Rebane (#8)
Re: Right version of jdbc

remove the postgresql-8.3-603.jdbc4.jar
Dave Cramer
www.postgres.rocks

On Mon, 25 Sept 2023 at 08:43, Raivo Rebane <raivore55@gmail.com> wrote:

Show quoted text

And target/lib is s following :
Directory of C:\Users\Raivo\eclipse-workspace\backendproject\target\lib

25.09.2023 15:35 <DIR> .
25.09.2023 15:33 <DIR> ..
25.09.2023 15:33 214 381 checker-qual-3.5.0.jar
25.09.2023 13:14 75 847 postgis-jdbc-1.3.3.jar
25.09.2023 13:14 2 833 postgis-stubs-1.3.3.jar
25.09.2023 15:33 1 049 651 postgresql-42.5.4.jar
25.09.2023 13:14 474 746 postgresql-8.3-603.jdbc4.jar

Raivo

On Mon, Sep 25, 2023 at 3:38 PM Raivo Rebane <raivore55@gmail.com> wrote:

Hi, now I use -
<dependencies>
<dependency>
<groupId>org.postgis</groupId>
<artifactId>postgis-jdbc</artifactId>
<version>1.3.3</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.5.4</version> <!-- Kasuta kõige uuemat versiooni -->
</dependency>
</dependencies>
But I 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)

Whats wrong ?

Raivo

On Mon, Sep 25, 2023 at 3:26 PM Raivo Rebane <raivore55@gmail.com> wrote:

Hi,
now I using following -
[INFO] Copying postgis-jdbc-2.1.7.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgis-jdbc-2.1.7.jar
[INFO] Copying postgresql-42.6.0.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgresql-42.6.0.jar
[INFO] Copying checker-qual-3.31.0.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\checker-qual-3.31.0.jar
but on executions I got -
Exception in thread "main" java.lang.NoClassDefFoundError:
org/postgis/PGgeometry
at
backendproject.ProcQueryMushrooms.ProcQuery(ProcQueryMushrooms.java:41)
at backendproject.BackendMain.main(BackendMain.java:81)
Caused by: java.lang.ClassNotFoundException: org.postgis.PGgeometry
at
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at
java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)

What I have to do ?

I use following -
PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
PostGIS 3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
Regards
Raivo

On Mon, Sep 25, 2023 at 2:29 PM Dave Cramer <davecramer@postgres.rocks>
wrote:

Sorry 42.6.0

Interesting that github still has 42.5.4 as the release

Dave Cramer
www.postgres.rocks

On Mon, 25 Sept 2023 at 07:27, Dave Cramer <davecramer@postgres.rocks>
wrote:

Hi,

The latest version of the driver is usually the right answer. So 42.5.4
Dave Cramer
www.postgres.rocks

On Mon, 25 Sept 2023 at 07:03, Raivo Rebane <raivore55@gmail.com>
wrote:

Hi,
I use :
PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
and
PostGIS 3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1

What versions of jdbc driver I have to use for proper work ?

Regards,
Raivo

#10Dave Cramer
pg@fastcrypt.com
In reply to: Dave Cramer (#9)
Re: Right version of jdbc

It must be a dependency to something. postgis ?

Dave Cramer
www.postgres.rocks

On Mon, 25 Sept 2023 at 09:25, Raivo Rebane <raivore55@gmail.com> wrote:

Show quoted text

Hi,
postgresql-8.3-603.jdbc4.jar is added by maven maven install. How to
avoid it ?

#11Rob Sargent
robjsargent@gmail.com
In reply to: Raivo Rebane (#7)
Re: Right version of jdbc

On 9/25/23 06:38, Raivo Rebane wrote:

Hi, now I use -
  <dependencies>
    <dependency>
        <groupId>org.postgis</groupId>
        <artifactId>postgis-jdbc</artifactId>
        <version>1.3.3</version>
    </dependency>
    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>42.5.4</version> <!-- Kasuta kõige uuemat versiooni -->
    </dependency>
  </dependencies>
But I 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)

Whats wrong ?

Show your application CLASSPATH.

#12Dave Cramer
pg@fastcrypt.com
In reply to: Raivo Rebane (#8)
Re: Right version of jdbc

You should probably be using the latest version of postgis-jdbc

Maven Repository: net.postgis » postgis-jdbc » 2021.1.0 (mvnrepository.com)
<https://mvnrepository.com/artifact/net.postgis/postgis-jdbc/2021.1.0&gt;

Dave Cramer
www.postgres.rocks

On Mon, 25 Sept 2023 at 08:43, Raivo Rebane <raivore55@gmail.com> wrote:

Show quoted text

And target/lib is s following :
Directory of C:\Users\Raivo\eclipse-workspace\backendproject\target\lib

25.09.2023 15:35 <DIR> .
25.09.2023 15:33 <DIR> ..
25.09.2023 15:33 214 381 checker-qual-3.5.0.jar
25.09.2023 13:14 75 847 postgis-jdbc-1.3.3.jar
25.09.2023 13:14 2 833 postgis-stubs-1.3.3.jar
25.09.2023 15:33 1 049 651 postgresql-42.5.4.jar
25.09.2023 13:14 474 746 postgresql-8.3-603.jdbc4.jar

Raivo

On Mon, Sep 25, 2023 at 3:38 PM Raivo Rebane <raivore55@gmail.com> wrote:

Hi, now I use -
<dependencies>
<dependency>
<groupId>org.postgis</groupId>
<artifactId>postgis-jdbc</artifactId>
<version>1.3.3</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.5.4</version> <!-- Kasuta kõige uuemat versiooni -->
</dependency>
</dependencies>
But I 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)

Whats wrong ?

Raivo

On Mon, Sep 25, 2023 at 3:26 PM Raivo Rebane <raivore55@gmail.com> wrote:

Hi,
now I using following -
[INFO] Copying postgis-jdbc-2.1.7.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgis-jdbc-2.1.7.jar
[INFO] Copying postgresql-42.6.0.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\postgresql-42.6.0.jar
[INFO] Copying checker-qual-3.31.0.jar to
C:\Users\Raivo\eclipse-workspace\backendproject\target\lib\checker-qual-3.31.0.jar
but on executions I got -
Exception in thread "main" java.lang.NoClassDefFoundError:
org/postgis/PGgeometry
at
backendproject.ProcQueryMushrooms.ProcQuery(ProcQueryMushrooms.java:41)
at backendproject.BackendMain.main(BackendMain.java:81)
Caused by: java.lang.ClassNotFoundException: org.postgis.PGgeometry
at
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at
java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)

What I have to do ?

I use following -
PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
PostGIS 3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
Regards
Raivo

On Mon, Sep 25, 2023 at 2:29 PM Dave Cramer <davecramer@postgres.rocks>
wrote:

Sorry 42.6.0

Interesting that github still has 42.5.4 as the release

Dave Cramer
www.postgres.rocks

On Mon, 25 Sept 2023 at 07:27, Dave Cramer <davecramer@postgres.rocks>
wrote:

Hi,

The latest version of the driver is usually the right answer. So 42.5.4
Dave Cramer
www.postgres.rocks

On Mon, 25 Sept 2023 at 07:03, Raivo Rebane <raivore55@gmail.com>
wrote:

Hi,
I use :
PostgreSQL 15.2, compiled by Visual C++ build 1914, 64-bit
and
PostGIS 3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1

What versions of jdbc driver I have to use for proper work ?

Regards,
Raivo

#13Dave Cramer
pg@fastcrypt.com
In reply to: Dave Cramer (#12)
Re: Right version of jdbc

First of all please use reply all so that everyone sees the answers.

Not sure since PgObject is certainly in the jdbc jar.
pgjdbc/pgjdbc/src/main/java/org/postgresql/util/PGobject.java
at 5709a20fbef453749d2394e11502527e4a3ab5bb · pgjdbc/pgjdbc (github.com)
<https://github.com/pgjdbc/pgjdbc/blob/5709a20fbef453749d2394e11502527e4a3ab5bb/pgjdbc/src/main/java/org/postgresql/util/PGobject.java#L19&gt;

I suggest at this point you provide a test project on github that you can
share.

There is something wrong with the classpath

Dave Cramer
www.postgres.rocks

On Wed, 27 Sept 2023 at 01:52, Raivo Rebane <raivore55@gmail.com> wrote:

Show quoted text

Hi,
Thanks for response, but if I using following dependencies :

<dependencies>

<dependency>

<groupId>net.postgis</groupId>

<artifactId>postgis-jdbc</artifactId>

<version>2021.1.0</version>

</dependency>

<dependency>

<groupId>org.postgresql</groupId>

<artifactId>postgresql</artifactId>

<version>42.6.0</version> <!-- Kasuta kõige uuemat versiooni -->

</dependency>

</dependencies>

I have error :

The type org.postgresql.util.PGobject cannot be resolved. It is indirectly
referenced from required type org.postgis.PGgeometry

What is wrong with me ?

Raivo

#14Raivo Rebane
raivore55@gmail.com
In reply to: Dave Cramer (#13)
Re: Right version of jdbc

Hi,

I made a new Java application Eclipse Dynamic WEB application and want to
use Postgres - PostgreSQL 10.14 on x86_64-pc-linux-gnu, compiled by gcc
(Ubuntu 9.3.0-10ubuntu2) 9.3.0, 64-bit and Postgis - 2.4 USE_GEOS=1
USE_PROJ=1 USE_STATS=1.

I added some jdbc-s in my project webapps/WEB-INF/lib directory which now
contains - javax.servlet-api.jar postgis-jdbc-2.2.1.jar
postgresql-42.2.5.jre7.jar.

But they don't fit the needs and I got from tomcat -
java.sql.SQLException: No suitable driver found for
jdbc:postgresql://localhost:5432/mushroom_database
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:702)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)
at MushroomAPIs.AddMushrooms.doGet(AddMushrooms.java:30)

What's wrong. Or is better to use more newer postgres. And then which
jdbc-I need to use ?

Regards
Raivo

On Wed, Sep 27, 2023 at 12:43 PM Dave Cramer <davecramer@postgres.rocks>
wrote:

Show quoted text

First of all please use reply all so that everyone sees the answers.

Not sure since PgObject is certainly in the jdbc jar. pgjdbc/pgjdbc/src/main/java/org/postgresql/util/PGobject.java
at 5709a20fbef453749d2394e11502527e4a3ab5bb · pgjdbc/pgjdbc (github.com)
<https://github.com/pgjdbc/pgjdbc/blob/5709a20fbef453749d2394e11502527e4a3ab5bb/pgjdbc/src/main/java/org/postgresql/util/PGobject.java#L19&gt;

I suggest at this point you provide a test project on github that you can
share.

There is something wrong with the classpath

Dave Cramer
www.postgres.rocks

On Wed, 27 Sept 2023 at 01:52, Raivo Rebane <raivore55@gmail.com> wrote:

Hi,
Thanks for response, but if I using following dependencies :

<dependencies>

<dependency>

<groupId>net.postgis</groupId>

<artifactId>postgis-jdbc</artifactId>

<version>2021.1.0</version>

</dependency>

<dependency>

<groupId>org.postgresql</groupId>

<artifactId>postgresql</artifactId>

<version>42.6.0</version> <!-- Kasuta kõige uuemat versiooni -->

</dependency>

</dependencies>

I have error :

The type org.postgresql.util.PGobject cannot be resolved. It is
indirectly referenced from required type org.postgis.PGgeometry

What is wrong with me ?

Raivo

#15Dave Cramer
pg@fastcrypt.com
In reply to: Raivo Rebane (#14)
Re: Right version of jdbc

Dave Cramer
www.postgres.rocks

On Thu, 28 Sept 2023 at 02:18, Raivo Rebane <raivore55@gmail.com> wrote:

Hi,

I made a new Java application Eclipse Dynamic WEB application and want to
use Postgres - PostgreSQL 10.14 on x86_64-pc-linux-gnu, compiled by gcc
(Ubuntu 9.3.0-10ubuntu2) 9.3.0, 64-bit and Postgis - 2.4 USE_GEOS=1
USE_PROJ=1 USE_STATS=1.

I added some jdbc-s in my project webapps/WEB-INF/lib directory which now
contains - javax.servlet-api.jar postgis-jdbc-2.2.1.jar
postgresql-42.2.5.jre7.jar.

postgresql-42.2.5.jre7.jar. is for java 7.
I suggest you use the latest versions of postgis and postgres jdbc

Dave

Show quoted text

But they don't fit the needs and I got from tomcat -
java.sql.SQLException: No suitable driver found for
jdbc:postgresql://localhost:5432/mushroom_database
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:702)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)
at MushroomAPIs.AddMushrooms.doGet(AddMushrooms.java:30)

What's wrong. Or is better to use more newer postgres. And then which
jdbc-I need to use ?

Regards
Raivo

On Wed, Sep 27, 2023 at 12:43 PM Dave Cramer <davecramer@postgres.rocks>
wrote:

First of all please use reply all so that everyone sees the answers.

Not sure since PgObject is certainly in the jdbc jar. pgjdbc/pgjdbc/src/main/java/org/postgresql/util/PGobject.java
at 5709a20fbef453749d2394e11502527e4a3ab5bb · pgjdbc/pgjdbc (github.com)
<https://github.com/pgjdbc/pgjdbc/blob/5709a20fbef453749d2394e11502527e4a3ab5bb/pgjdbc/src/main/java/org/postgresql/util/PGobject.java#L19&gt;

I suggest at this point you provide a test project on github that you can
share.

There is something wrong with the classpath

Dave Cramer
www.postgres.rocks

On Wed, 27 Sept 2023 at 01:52, Raivo Rebane <raivore55@gmail.com> wrote:

Hi,
Thanks for response, but if I using following dependencies :

<dependencies>

<dependency>

<groupId>net.postgis</groupId>

<artifactId>postgis-jdbc</artifactId>

<version>2021.1.0</version>

</dependency>

<dependency>

<groupId>org.postgresql</groupId>

<artifactId>postgresql</artifactId>

<version>42.6.0</version> <!-- Kasuta kõige uuemat versiooni -->

</dependency>

</dependencies>

I have error :

The type org.postgresql.util.PGobject cannot be resolved. It is
indirectly referenced from required type org.postgis.PGgeometry

What is wrong with me ?

Raivo

#16Raivo Rebane
raivore55@gmail.com
In reply to: Dave Cramer (#15)
Re: Right version of jdbc

Now I changed the Postgres Server to version 15 and making Tomcat 9.0
project.
Now I am using postgresql-42.6.0.jar driver, but Tomcat gives error :
java.sql.SQLException: No suitable driver found for
jdbc:postgresql://localhost:5432/mushroom_database
What driver I have to use for suitable driver.
Or must I downgrade my postgres version ?

Regards
Raivo

On Thu, Sep 28, 2023 at 12:32 PM Dave Cramer <davecramer@postgres.rocks>
wrote:

Show quoted text

Dave Cramer
www.postgres.rocks

On Thu, 28 Sept 2023 at 02:18, Raivo Rebane <raivore55@gmail.com> wrote:

Hi,

I made a new Java application Eclipse Dynamic WEB application and want to
use Postgres - PostgreSQL 10.14 on x86_64-pc-linux-gnu, compiled by gcc
(Ubuntu 9.3.0-10ubuntu2) 9.3.0, 64-bit and Postgis - 2.4 USE_GEOS=1
USE_PROJ=1 USE_STATS=1.

I added some jdbc-s in my project webapps/WEB-INF/lib directory which now
contains - javax.servlet-api.jar postgis-jdbc-2.2.1.jar
postgresql-42.2.5.jre7.jar.

postgresql-42.2.5.jre7.jar. is for java 7.
I suggest you use the latest versions of postgis and postgres jdbc

Dave

But they don't fit the needs and I got from tomcat -
java.sql.SQLException: No suitable driver found for
jdbc:postgresql://localhost:5432/mushroom_database
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:702)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)
at MushroomAPIs.AddMushrooms.doGet(AddMushrooms.java:30)

What's wrong. Or is better to use more newer postgres. And then which
jdbc-I need to use ?

Regards
Raivo

On Wed, Sep 27, 2023 at 12:43 PM Dave Cramer <davecramer@postgres.rocks>
wrote:

First of all please use reply all so that everyone sees the answers.

Not sure since PgObject is certainly in the jdbc jar. pgjdbc/pgjdbc/src/main/java/org/postgresql/util/PGobject.java
at 5709a20fbef453749d2394e11502527e4a3ab5bb · pgjdbc/pgjdbc (github.com)
<https://github.com/pgjdbc/pgjdbc/blob/5709a20fbef453749d2394e11502527e4a3ab5bb/pgjdbc/src/main/java/org/postgresql/util/PGobject.java#L19&gt;

I suggest at this point you provide a test project on github that you
can share.

There is something wrong with the classpath

Dave Cramer
www.postgres.rocks

On Wed, 27 Sept 2023 at 01:52, Raivo Rebane <raivore55@gmail.com> wrote:

Hi,
Thanks for response, but if I using following dependencies :

<dependencies>

<dependency>

<groupId>net.postgis</groupId>

<artifactId>postgis-jdbc</artifactId>

<version>2021.1.0</version>

</dependency>

<dependency>

<groupId>org.postgresql</groupId>

<artifactId>postgresql</artifactId>

<version>42.6.0</version> <!-- Kasuta kõige uuemat versiooni -->

</dependency>

</dependencies>

I have error :

The type org.postgresql.util.PGobject cannot be resolved. It is
indirectly referenced from required type org.postgis.PGgeometry

What is wrong with me ?

Raivo

#17Rob Sargent
robjsargent@gmail.com
In reply to: Raivo Rebane (#16)
Re: Right version of jdbc

On 9/28/23 09:41, Raivo Rebane wrote:

Now I changed the Postgres Server to version 15 and making Tomcat 9.0
project.
Now I am using postgresql-42.6.0.jar driver, but Tomcat gives error :
java.sql.SQLException: No suitable driver found for
jdbc:postgresql://localhost:5432/mushroom_database
What driver I have to use for suitable driver.
Or must I downgrade my postgres version ?

Can you show the code you use to make the database connection?

#18Raivo Rebane
raivore55@gmail.com
In reply to: Raivo Rebane (#16)
Re: Right version of jdbc

Or may be I am using wrong version of Java - java version "17.0.8"
2023-07-18 LTS

Raivo

On Thu, Sep 28, 2023 at 6:41 PM Raivo Rebane <raivore55@gmail.com> wrote:

Show quoted text

Now I changed the Postgres Server to version 15 and making Tomcat 9.0
project.
Now I am using postgresql-42.6.0.jar driver, but Tomcat gives error :
java.sql.SQLException: No suitable driver found for
jdbc:postgresql://localhost:5432/mushroom_database
What driver I have to use for suitable driver.
Or must I downgrade my postgres version ?

Regards
Raivo

On Thu, Sep 28, 2023 at 12:32 PM Dave Cramer <davecramer@postgres.rocks>
wrote:

Dave Cramer
www.postgres.rocks

On Thu, 28 Sept 2023 at 02:18, Raivo Rebane <raivore55@gmail.com> wrote:

Hi,

I made a new Java application Eclipse Dynamic WEB application and want
to use Postgres - PostgreSQL 10.14 on x86_64-pc-linux-gnu, compiled by gcc
(Ubuntu 9.3.0-10ubuntu2) 9.3.0, 64-bit and Postgis - 2.4 USE_GEOS=1
USE_PROJ=1 USE_STATS=1.

I added some jdbc-s in my project webapps/WEB-INF/lib directory which
now contains - javax.servlet-api.jar postgis-jdbc-2.2.1.jar
postgresql-42.2.5.jre7.jar.

postgresql-42.2.5.jre7.jar. is for java 7.
I suggest you use the latest versions of postgis and postgres jdbc

Dave

But they don't fit the needs and I got from tomcat -
java.sql.SQLException: No suitable driver found for
jdbc:postgresql://localhost:5432/mushroom_database
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:702)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)
at MushroomAPIs.AddMushrooms.doGet(AddMushrooms.java:30)

What's wrong. Or is better to use more newer postgres. And then which
jdbc-I need to use ?

Regards
Raivo

On Wed, Sep 27, 2023 at 12:43 PM Dave Cramer <davecramer@postgres.rocks>
wrote:

First of all please use reply all so that everyone sees the answers.

Not sure since PgObject is certainly in the jdbc jar. pgjdbc/pgjdbc/src/main/java/org/postgresql/util/PGobject.java
at 5709a20fbef453749d2394e11502527e4a3ab5bb · pgjdbc/pgjdbc (github.com)
<https://github.com/pgjdbc/pgjdbc/blob/5709a20fbef453749d2394e11502527e4a3ab5bb/pgjdbc/src/main/java/org/postgresql/util/PGobject.java#L19&gt;

I suggest at this point you provide a test project on github that you
can share.

There is something wrong with the classpath

Dave Cramer
www.postgres.rocks

On Wed, 27 Sept 2023 at 01:52, Raivo Rebane <raivore55@gmail.com>
wrote:

Hi,
Thanks for response, but if I using following dependencies :

<dependencies>

<dependency>

<groupId>net.postgis</groupId>

<artifactId>postgis-jdbc</artifactId>

<version>2021.1.0</version>

</dependency>

<dependency>

<groupId>org.postgresql</groupId>

<artifactId>postgresql</artifactId>

<version>42.6.0</version> <!-- Kasuta kõige uuemat versiooni -->

</dependency>

</dependencies>

I have error :

The type org.postgresql.util.PGobject cannot be resolved. It is
indirectly referenced from required type org.postgis.PGgeometry

What is wrong with me ?

Raivo

#19Dave Cramer
pg@fastcrypt.com
In reply to: Raivo Rebane (#18)
Re: Right version of jdbc

Please put this project on github so we can see it.

Thanks
Dave Cramer
www.postgres.rocks

On Thu, 28 Sept 2023 at 11:53, Raivo Rebane <raivore55@gmail.com> wrote:

Show quoted text

Or may be I am using wrong version of Java - java version "17.0.8"
2023-07-18 LTS

Raivo

On Thu, Sep 28, 2023 at 6:41 PM Raivo Rebane <raivore55@gmail.com> wrote:

Now I changed the Postgres Server to version 15 and making Tomcat 9.0
project.
Now I am using postgresql-42.6.0.jar driver, but Tomcat gives error :
java.sql.SQLException: No suitable driver found for
jdbc:postgresql://localhost:5432/mushroom_database
What driver I have to use for suitable driver.
Or must I downgrade my postgres version ?

Regards
Raivo

On Thu, Sep 28, 2023 at 12:32 PM Dave Cramer <davecramer@postgres.rocks>
wrote:

Dave Cramer
www.postgres.rocks

On Thu, 28 Sept 2023 at 02:18, Raivo Rebane <raivore55@gmail.com> wrote:

Hi,

I made a new Java application Eclipse Dynamic WEB application and want
to use Postgres - PostgreSQL 10.14 on x86_64-pc-linux-gnu, compiled by gcc
(Ubuntu 9.3.0-10ubuntu2) 9.3.0, 64-bit and Postgis - 2.4 USE_GEOS=1
USE_PROJ=1 USE_STATS=1.

I added some jdbc-s in my project webapps/WEB-INF/lib directory which
now contains - javax.servlet-api.jar postgis-jdbc-2.2.1.jar
postgresql-42.2.5.jre7.jar.

postgresql-42.2.5.jre7.jar. is for java 7.
I suggest you use the latest versions of postgis and postgres jdbc

Dave

But they don't fit the needs and I got from tomcat -
java.sql.SQLException: No suitable driver found for
jdbc:postgresql://localhost:5432/mushroom_database
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:702)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)
at MushroomAPIs.AddMushrooms.doGet(AddMushrooms.java:30)

What's wrong. Or is better to use more newer postgres. And then which
jdbc-I need to use ?

Regards
Raivo

On Wed, Sep 27, 2023 at 12:43 PM Dave Cramer <davecramer@postgres.rocks>
wrote:

First of all please use reply all so that everyone sees the answers.

Not sure since PgObject is certainly in the jdbc jar. pgjdbc/pgjdbc/src/main/java/org/postgresql/util/PGobject.java
at 5709a20fbef453749d2394e11502527e4a3ab5bb · pgjdbc/pgjdbc (github.com)
<https://github.com/pgjdbc/pgjdbc/blob/5709a20fbef453749d2394e11502527e4a3ab5bb/pgjdbc/src/main/java/org/postgresql/util/PGobject.java#L19&gt;

I suggest at this point you provide a test project on github that you
can share.

There is something wrong with the classpath

Dave Cramer
www.postgres.rocks

On Wed, 27 Sept 2023 at 01:52, Raivo Rebane <raivore55@gmail.com>
wrote:

Hi,
Thanks for response, but if I using following dependencies :

<dependencies>

<dependency>

<groupId>net.postgis</groupId>

<artifactId>postgis-jdbc</artifactId>

<version>2021.1.0</version>

</dependency>

<dependency>

<groupId>org.postgresql</groupId>

<artifactId>postgresql</artifactId>

<version>42.6.0</version> <!-- Kasuta kõige uuemat versiooni -->

</dependency>

</dependencies>

I have error :

The type org.postgresql.util.PGobject cannot be resolved. It is
indirectly referenced from required type org.postgis.PGgeometry

What is wrong with me ?

Raivo

#20Ron
ronljohnsonjr@gmail.com
In reply to: Raivo Rebane (#14)
Re: Right version of jdbc

On 9/28/23 01:18, Raivo Rebane wrote:
[snip]

I made a new Java application Eclipse Dynamic WEB application and want to
use Postgres - PostgreSQL 10.14

[snip]

What's wrong. Or is better to use more newer postgres. And then which
jdbc-I need to use ?

https://www.postgresql.org/support/versioning/

Pg 10 will be EOL in *6 weeks*.  Thus, "yes, use a newer version of
Postgresql" (unless, like me, you're constrained by circumstances like "the
business won't let us upgrade").

Pg 15 and the latest JDBC are in the repositories:
https://www.postgresql.org/download/

--
Born in Arizona, moved to Babylonia.

#21Raivo Rebane
raivore55@gmail.com
In reply to: Ron (#20)
#22Dave Cramer
pg@fastcrypt.com
In reply to: Raivo Rebane (#21)
#23Raivo Rebane
raivore55@gmail.com
In reply to: Dave Cramer (#22)
#24Raivo Rebane
raivore55@gmail.com
In reply to: Raivo Rebane (#23)
#25Dave Cramer
pg@fastcrypt.com
In reply to: Raivo Rebane (#24)
#26Noname
postgresql439848@heinz-it.de
In reply to: Dave Cramer (#25)
#27Craig McIlwee
craigm@vt.edu
In reply to: Dave Cramer (#25)
#28Raivo Rebane
raivore55@gmail.com
In reply to: Craig McIlwee (#27)
#29Raivo Rebane
raivore55@gmail.com
In reply to: Raivo Rebane (#28)
#30Raivo Rebane
raivore55@gmail.com
In reply to: Raivo Rebane (#29)
#31Raivo Rebane
raivore55@gmail.com
In reply to: Raivo Rebane (#30)
#32Raivo Rebane
raivore55@gmail.com
In reply to: Raivo Rebane (#31)
#33Noname
postgresql439848@heinz-it.de
In reply to: Raivo Rebane (#31)
#34Raivo Rebane
raivore55@gmail.com
In reply to: Raivo Rebane (#32)
#35Raivo Rebane
raivore55@gmail.com
In reply to: Noname (#33)
#36Dave Cramer
pg@fastcrypt.com
In reply to: Raivo Rebane (#35)
#37Raivo Rebane
raivore55@gmail.com
In reply to: Dave Cramer (#36)