Skip site navigation (1) Skip section navigation (2)

Re: JDBC 3.0 / JDK 1.4 build issues

From: Rene Pijlman <rene(at)lab(dot)applinet(dot)nl>
To: Ned Wolpert <wolpert(at)yahoo(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: JDBC 3.0 / JDK 1.4 build issues
Date: 2001-12-09 17:21:08
Message-ID: 3n671u0lv7s7vk8st8lsn9tjvk508e6vij@4ax.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
On Sun, 9 Dec 2001 07:14:01 -0800 (PST), you wrote:
>Oh yeah. That's right.  Since org.postgresql.jdbc2.Connection is a
>'complete' implementation of java.sql.Conenction, it cannot compile
>cleanly with jdk1.4.  So, one cannot inherit from the jdbc2.Connection
>object.  It has to be a clean jdbc3 Connection.  Ugh.

And how about this code reorganization scheme?

org/postgresql/Connection.java
package org.postgresql;
public abstract class Connection 
// Contains code that is common to jdbc1, jdbc2 and jdbc3

org/postgresql/Connection2.java
package org.postgresql;
public abstract class Connection2 
extends org.postgresql.Connection
// Contains code that is common to jdbc2 and jdbc3, 
// but cannot compile with jdbc1

    org/postgresql/jdbc1/Connection.java
    package org.postgresql.jdbc1;
    public class Connection 
    extends org.postgresql.Connection 
    implements java.sql.Connection
    // ant: only compiled when JDBC1
    // Contains code that is valid only for jdbc1
    
    org/postgresql/jdbc2/Connection.java
    package org.postgresql.jdbc2;
    public class Connection
    extends org.postgresql.Connection2
    implements java.sql.Connection
    // ant: only compiled when JDBC2
    // Contains code that is valid only for jdbc2
    
    org/postgresql/jdbc3/Connection.java
    package org.postgresql.jdbc3;
    public class Connection
    extends org.postgresql.Connection2
    implements java.sql.Connection
    // ant: only compiled when JDBC3
    // Contains code that is valid only for jdbc3

Perhaps Connection2.java should go in the jdbc2 package. 

I'll see if I can get this to work with 1.3/1.4.

>(And in both cases, we still have the ant vs. make discussion
>to solve) thoughts? Ideas on how can simplify this so jdbc4 doesn't
>do this to us again? (Or is this accecptable/normal situation?)  

Another interesting idea is to build all versions of the driver
into one .jar file and choose the right classes at runtime
(using reflection in JDK >= 1.1). This would reduce the number
of driver versions we have to distribute and would make
deployment easier. Building the driver this way would be more
complicated though, since it requires all JDK versions to be
available on the build platform. Just a thought :-)

Regards,
René Pijlman <rene(at)lab(dot)applinet(dot)nl>

In response to

Responses

pgsql-jdbc by date

Next:From: Ned WolpertDate: 2001-12-09 21:48:36
Subject: Re: Bug with caching SQLTypes in Connection:getSQLType(oid)
Previous:From: Ned WolpertDate: 2001-12-09 15:38:40
Subject: Re: JDBC 3.0 / JDK 1.4 build issues

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group