Re: Pre-processing during build

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>
Cc: Markus KARG <markus(at)headcrashing(dot)eu>, List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Pre-processing during build
Date: 2015-06-15 22:54:14
Message-ID: CADK3HHJo=bjA9z=ZBzk-vqxfu+0Eh4UmLd0WJUhngKAVYogz8w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

I'm wondering if we use the latest JRE to compile but target 1.7 will it
use the latest JDBC API, but compile to 1.7 bytecode. Apparently
https://github.com/brettwooldridge/HikariCP uses this method; and they have
a similar problem

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca

On 15 June 2015 at 18:47, Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>
wrote:

> Marcus,
>
> >Has anybody tried whether it is possible to simply load a JRE8-JDBC42.jar
> on JRE6?
>
> As you are a fan of JEPs, you might know of
> http://openjdk.java.net/jeps/238 : Multi-Version JAR Files
> It does not "just work" yet.
>
> Suppose you want implement PreparedStatement(...java.sql.SQLType)
> features of JDBC 4.2 (see [1]).
> Even if you compile that with target 1.7, JRE 7 might fail to load the
> class as it won't be able to validate what that SQLType is. It just
> does not exist in JRE7.
>
> As far as I understand, the only manageable way of using "new
> features" in "JDK6-7 jars" is to isolate JDK8-using methods to
> JDK8-only-loaded classes. For instance, PreparedStatement41.java and
> PreparedStatement42.java
>
> [1]:
> https://docs.oracle.com/javase/8/docs/api/java/sql/PreparedStatement.html#setObject-int-java.lang.Object-java.sql.SQLType-
>
> Vladimir
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Mark Rotteveel 2015-06-16 06:59:04 Re: Pre-processing during build
Previous Message Vladimir Sitnikov 2015-06-15 22:47:46 Re: Pre-processing during build