pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bogdan Daniliuc <bdaniliuc@montran.com>
To: Dave Cramer <pg@fastcrypt.com>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: Problem updating driver to 42.0.0
Date: Mon, 6 Mar 2017 10:23:12 +0200
Message-ID: <bd1e7b17-b1eb-c9f3-9d50-1be85a5e1410@montran.com> (raw)
In-Reply-To: <CADK3HH+CvELEBTu188n7io-4zyJynupw3cNG33CVAOWNnT-kDg@mail.gmail.com>
References: <971d94c7-a5a5-45fb-e785-37a5ad8ebf1f@montran.com>
	<CADK3HH+CvELEBTu188n7io-4zyJynupw3cNG33CVAOWNnT-kDg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

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@postgresintl.com <mailto:davec@postgresintl.com>
> www.postgresintl.com <http://www.postgresintl.com;
>
> On 3 March 2017 at 04:40, Bogdan Daniliuc <bdaniliuc@montran.com 
> <mailto:bdaniliuc@montran.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(BaseDataSource.java:79)
>         at
>     org.postgresql.ds.PGConnectionPoolDataSource.getPooledConnection(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@postgresql.org
>     <mailto:pgsql-jdbc@postgresql.org>)
>     To make changes to your subscription:
>     http://www.postgresql.org/mailpref/pgsql-jdbc
>     <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.

view thread (4+ messages)  latest in thread

Message-ID: <bd1e7b17-b1eb-c9f3-9d50-1be85a5e1410@montran.com>
Permalink:  ../bd1e7b17-b1eb-c9f3-9d50-1be85a5e1410@montran.com/
Also on:    postgresql.org/message-id/bd1e7b17-b1eb-c9f3-9d50-1be85a5e1410@montran.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: bdaniliuc@montran.com, pg@fastcrypt.com
  Subject: Re: Problem updating driver to 42.0.0
  In-Reply-To: <bd1e7b17-b1eb-c9f3-9d50-1be85a5e1410@montran.com>
  References: <971d94c7-a5a5-45fb-e785-37a5ad8ebf1f@montran.com> <CADK3HH+CvELEBTu188n7io-4zyJynupw3cNG33CVAOWNnT-kDg@mail.gmail.com> <bd1e7b17-b1eb-c9f3-9d50-1be85a5e1410@montran.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox