Re: Problem updating driver to 42.0.0

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Bogdan Daniliuc <bdaniliuc(at)montran(dot)com>
Cc: List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Problem updating driver to 42.0.0
Date: 2017-03-06 11:50:54
Message-ID: CADK3HHKSPbf94tsKbD_PnVVo7Ly6SyikOv_eX2e0rZxJgVik0Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi Bogdan,

Thanks for this!

Dave Cramer

davec(at)postgresintl(dot)com
www.postgresintl.com

On 6 March 2017 at 03:23, Bogdan Daniliuc <bdaniliuc(at)montran(dot)com> wrote:

> Hi Dave,
>
> There is a WebSphere variable defined, POSTGRES_JDBC_DRIVER_PATH pointing
> to that folder. The JDBC provider is then defined having the database class
> path information either ${POSTGRES_JDBC_DRIVER_PATH}/postgresql-9.4.1212.jar
> or ${POSTGRES_JDBC_DRIVER_PATH}/postgresql-42.0.0.jar.
>
> The folder contains only the corresponding JAR file to eliminate any
> interference.
>
> I performed additional experiments, based on the assumption that this is a
> class loader issue. After we added in org.postgresql.ds.common.BaseDataSource
> the following code (that is present in 9.4.12121 but not in 42.0.0), the
> driver worked:
>
> static {
> try {
> Class.forName("org.postgresql.Driver");
> } catch (ClassNotFoundException e) {
> System.err.println("PostgreSQL DataSource unable to load
> PostgreSQL JDBC Driver");
> }
> }
>
> I'm not sure if this is the correct fix.
>
> Thank you,
>
> Bogdan Daniliuc
>
>
>
> Hi Bogdan
>
> How would websphere find it if was in c:\driver
>
> I'm sort of clue free here ?
>
> Dave Cramer
>
> davec(at)postgresintl(dot)com
> www.postgresintl.com
>
> On 3 March 2017 at 04:40, Bogdan Daniliuc <bdaniliuc(at)montran(dot)com> wrote:
>
>> Hello,
>>
>> We are encountering an error when trying to update the driver from
>> postgresql-9.4.1212 to postgresql-42.0.0 in WebSphere 8.5.5
>>
>> With 42.0.0, we get:
>>
>> Failed to create a ConnectionPoolDataSource from PostgreSQL JDBC Driver
>> 42.0.0 for testDB at jdbc:postgresql://localhost:5432/testDB:
>> java.sql.SQLException: No suitable driver found for
>> jdbc:postgresql://localhost:5432/testDB
>>
>> DSRA8201W: DataSource Configuration: DSRA8040I: Failed to connect to the
>> DataSource DS2. Encountered java.sql.SQLException: No suitable driver
>> found for jdbc:postgresql://localhost:5432/testDB DSRA0010E: SQL State =
>> 08001, Error Code = 0.
>> java.sql.SQLException: No suitable driver found for
>> jdbc:postgresql://localhost:5432/testDB DSRA0010E: SQL State = 08001,
>> Error Code = 0
>> at java.sql.DriverManager.getConnection(DriverManager.java:700)
>> at java.sql.DriverManager.getConnection(DriverManager.java:258)
>> at org.postgresql.ds.common.BaseDataSource.getConnection(BaseDa
>> taSource.java:79)
>> at org.postgresql.ds.PGConnectionPoolDataSource.getPooledConnec
>> tion(PGConnectionPoolDataSource.java:69)
>>
>>
>> The driver is in a c:\driver directory. It works if the driver is moved
>> in AppServer\java_1.8_64\jre\lib\ext, but this is not recommended by IBM.
>>
>> 9.2.1212 and 1211 all work when placed in the same directory.
>>
>> Thank you,
>>
>> Bogdan
>>
>>
>>
>> --
>> Sent via pgsql-jdbc mailing list (pgsql-jdbc(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-jdbc
>>
>
>
>
> --
>
> ___________________________________________________________
> This message and any attachments (the "message") is intended solely for the addressees and is confidential. If you receive this message in error, please delete it and immediately notify the sender. Any use not in accordance with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except with formal written approval. The sender cannot guarantee the integrity of this message. Montran Corporation (and its subsidiaries) shall not therefore be liable for the message if modified.
>
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Robert Haas 2017-03-06 18:24:00 Re: Statement-level rollback
Previous Message Bogdan Daniliuc 2017-03-06 08:23:12 Re: Problem updating driver to 42.0.0