Re: [INTERFACES] Java, JDBC & CORBA (fwd)

From: Peter T Mount <peter(at)taer(dot)maidstone(dot)gov(dot)uk>
To: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
Cc: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] Java, JDBC & CORBA (fwd)
Date: 1998-11-30 15:15:29
Message-ID: Pine.LNX.4.04.9811301503090.831-100000@taer.maidstone.gov.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

On Mon, 30 Nov 1998, Herouth Maoz wrote:

> At 16:26 +0200 on 30/11/98, Andrew R. Jackson wrote:
>
>
> > First, let me preface my answer to say that the main reason I am
> >subscribed to this list is to read Peter's, and occassionally others',
> >answers, comments, etc about using JDBC with Postgres.
> >
> > To answer Peter's question, personally I would prefer two drivers, each
> >separate. The reason for this is that I don't want a Makefile deciding
> >which one (1) will be compiled and installed when I have two (2) different
> >versions of Java on most of the systems I work on (most have 3 Javas,
> >actually). I'd hate to be locked into using one driver version, and thus
> >one Java version for Postgres stuff, because the Makefile only detected
> >one of the Javas (which would be the 1.1.x one for now and some long time
> >into the future). I want to choose. I want to be able to develop a Java
> >1.1.x solution and a Java 1.2 solution, not either/or.
> >
> > Now, what really matters is good install instructions. If the
> >instructions included ways to solve problems like the one above, then
> >that's best and I don't care. Nothing beats good, copius, verbose, clear,
> >well-maintained docs. :)
>
> How about a Makefile which has the two (three?) drivers as separate target.
> So, I can do a "make 1.1" "make 1.2". If we want to be sophisticated, make
> the default tarket (i.e. "make" without args) detect the version of Java on
> the current computer, and make the appropriate driver for it.

The lines I was thinking of was:

Have a target in the makefile that compiles the 1.1 driver, and generates
the current postgresql.jar file.

Have a second target that compiles the 1.2 driver, and generares say
postgresql2.jar

Have a third target that tests to see what jdk is currently available, and
issues the relevent target above.

This would then be the common way of compiling the driver, but it leaves
the ability to compile either one. See below for a possibility.

PS: When JDK1.2 is available for Linux, I will have 1.0.2, 1.1.7 & 1.2
installed (I still rarely use 1.0.2, hence it's still there).

> I just wonder if it's impossible for the driver to load the appropriate
> classes dynamically, based on the value of the "java.version" System
> property.

The postgresql.Driver class will be common between both drivers, for
compatibility reasons. As it's super class (java.sql.Driver) has not
changed, we can keep it unaltered.

Anyhow, I was thinking of adding code so when it creates a connection, it
creates postgresql.Connection when it's 1.1.x, and
postgresql.v2.Connection for 1.2.x

This does open a possibility of having both drivers in the same jar file,
however, it would have to be built using both 1.2 then 1.1 javacs, then
build the jar file.

In theory it should work, but we will have to wait until 1.2 final is out,
before trying it.

--
Peter Mount, IT Section
petermount(at)it(dot)maidstone(dot)gov(dot)uk
Anything I write here are my own views, and cannot be taken as being the
official words of Maidstone Borough Council

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Peter T Mount 1998-11-30 15:18:41 Re: [INTERFACES] Java, JDBC & CORBA (fwd)
Previous Message Herouth Maoz 1998-11-30 14:48:32 Re: [INTERFACES] Java, JDBC & CORBA (fwd)