Thread: Is it possible to load two different versions of the JDBC driver in the same application?
Is it possible to load two different versions of the JDBC driver in the same application?
From
Tecno Brain
Date:
I have a Java application that is using Postgres 9.1, and we use the latest 9.1 JDBC driver.
The same Java app requires access now to a Redshift cluster. Amazon recommends to use a Postgres 8 JDBC driver.Re: Is it possible to load two different versions of the JDBC driver in the same application?
From
Steven Schlansker
Date:
On Apr 11, 2014, at 2:28 PM, Tecno Brain <cerebrotecnologico@gmail.com> wrote: > I have a Java application that is using Postgres 9.1, and we use the latest 9.1 JDBC driver. > The same Java app requires access now to a Redshift cluster. Amazon recommends to use a Postgres 8 JDBC driver. Why? That’s ancient! Have you tested that the newer driver does not work? > > Can I load both drivers in the same application ? Technically, yes. You can load each driver in a separate classloader. You may wish to look into a container solution likeOSGI if you go this path. I wouldn’t recommend it. Diagnosing problems when multiple class loaders have the same classes loaded but different versionswill quickly melt your brain into a puddle of mush.
Re: Is it possible to load two different versions of the JDBC driver in the same application?
From
John R Pierce
Date:
On 4/11/2014 2:28 PM, Tecno Brain wrote: > I have a Java application that is using Postgres 9.1, and we use the > latest 9.1 JDBC driver. > The same Java app requires access now to a Redshift cluster. Amazon > recommends to use a Postgres 8 JDBC driver. the current JDBC driver works with all versions interchangeably. -- john r pierce 37N 122W somewhere on the middle of the left coast
Re: Is it possible to load two different versions of the JDBC driver in the same application?
From
Tecno Brain
Date:
Because the Amazon Redshift documentation states the following:
"The PostgreSQL 9.x JDBC and ODBC drivers might not work correctly with all applications when accessing Amazon Redshift. Currently, Amazon Redshift recommends the following version 8.4 JDBC and ODBC drivers:"
"The PostgreSQL 9.x JDBC and ODBC drivers might not work correctly with all applications when accessing Amazon Redshift. Currently, Amazon Redshift recommends the following version 8.4 JDBC and ODBC drivers:"
On Fri, Apr 11, 2014 at 2:32 PM, Steven Schlansker <stevenschlansker@gmail.com> wrote:
Why? That’s ancient! Have you tested that the newer driver does not work?
On Apr 11, 2014, at 2:28 PM, Tecno Brain <cerebrotecnologico@gmail.com> wrote:
> I have a Java application that is using Postgres 9.1, and we use the latest 9.1 JDBC driver.
> The same Java app requires access now to a Redshift cluster. Amazon recommends to use a Postgres 8 JDBC driver.Technically, yes. You can load each driver in a separate classloader. You may wish to look into a container solution like OSGI if you go this path.
>
> Can I load both drivers in the same application ?
I wouldn’t recommend it. Diagnosing problems when multiple class loaders have the same classes loaded but different versions will quickly melt your brain into a puddle of mush.