Re: Right version of jdbc

From: Dave Cramer <davecramer(at)postgres(dot)rocks>
To: Raivo Rebane <raivore55(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Right version of jdbc
Date: 2023-09-28 16:50:35
Message-ID: CADK3HHKHqL6+_Zj3a-JGmaNBhJXE-wNrxPPVXWKL0KR5=v2gvQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)gmail(dot)com> wrote:

> 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(at)gmail(dot)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(at)postgres(dot)rocks>
>> wrote:
>>
>>>
>>> Dave Cramer
>>> www.postgres.rocks
>>>
>>>
>>> On Thu, 28 Sept 2023 at 02:18, Raivo Rebane <raivore55(at)gmail(dot)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(at)postgres(dot)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>
>>>>>
>>>>> 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(at)gmail(dot)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
>>>>>>
>>>>>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Matt Zagrabelny 2023-09-28 18:24:08 Re: cast bytea to macaddr
Previous Message Raivo Rebane 2023-09-28 15:53:40 Re: Right version of jdbc