Re: Right version of jdbc - Mailing list pgsql-general

From Raivo Rebane
Subject Re: Right version of jdbc
Date
Msg-id CAMH5fptL3W-==pBWgOyEMJ5s-H-_1dfF7q7WkgQi+h0QPbhEyw@mail.gmail.com
Whole thread Raw
In response to Re: Right version of jdbc  (Dave Cramer <davecramer@postgres.rocks>)
Responses Re: Right version of jdbc
Re: Right version of jdbc
List pgsql-general
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:
First of all please use reply all so that everyone sees the answers.


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

pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: Ad hoc SETOF type definition?
Next
From: Philip Carlsen
Date:
Subject: Re: valid casts to anyarray