How to use two PostgreSQL DB versions in a single Java Application?

Viewed 99

In our Java project we have already connected two DB's to fetch data using two connection pools.

But now one of our DB is upgraded to PostgreSQL 12 and the other DB has the old PostgreSQL 8 version.

We have imported "postgresql-42.2.11.jar" in the project, Can this jar connect both versions or should we import the old "postgresql-8.1-407.jdbc3.jar" too. If so, will we get any error for using two PostgreSQL jars.

But the surprise is, The project works in local system perfectly connecting two versions of DB with one jar ("postgresql-42.2.11.jar"), Just throwing an warning "WARNING [http-nio-8084-exec-55] org.postgresql.jdbc.PgConnection. Unsupported Server Version: 8.1.11",

But after making it live in linux server its not working, it throws an abrupt error as "Exception org.postgresql.util.PSQLException: FATAL: invalid value for parameter "TimeZone": "Asia/Kolkata"".

1 Answers

It looks to me like the 'Kolkata' spelling was not added until June 2008, first appearing in v8.1.12, one minor version newer than you are using.

Related