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

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

From
"Andrew R. Jackson"
Date:
First, let me preface my answer to say that the main reason I am subscribed to this list is to read Peter's, and
occassionallyothers', 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
wanta Makefile deciding which one (1) will be compiled and installed when I have two (2) different versions of Java on
mostof the systems I work on (most have 3 Javas, actually). I'd hate to be locked into using one driver version, and
thusone Java version for Postgres stuff, because the Makefile only detected one of the Javas (which would be the 1.1.x
onefor 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
anda  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. :) 

Andrew R. Jackson
<ajackson@dezines.com>
<ajackson@cs.mcgill.ca>



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

From
Herouth Maoz
Date:
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.

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.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma



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

From
Peter T Mount
Date:
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@it.maidstone.gov.uk
Anything I write here are my own views, and cannot be taken as being the
official words of Maidstone Borough Council



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

From
Peter T Mount
Date:
On Mon, 30 Nov 1998, 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.

which was why I was asking on Friday why my posts weren't appearing on the
list - now solved.

> 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.

Which was why I posted the query. I wanted to find out what everyone
thought (see the other reply).

> 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. :)

There's a lot of documentation in the 6.4 docs directory (can't remember
how many pages, but before formatting, it was about 70 pages?).

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



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

From
Herouth Maoz
Date:
At 17:15 +0200 on 30/11/98, Peter T Mount wrote:


> 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.

Yes. That's what I meant.

Another possibility is to provide the driver in binary format. After all,
Java binaries are the same on all platforms.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma



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

From
Peter T Mount
Date:
On Mon, 30 Nov 1998, Herouth Maoz wrote:

> At 17:15 +0200 on 30/11/98, Peter T Mount wrote:
>
>
> > 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.
>
> Yes. That's what I meant.
>
> Another possibility is to provide the driver in binary format. After all,
> Java binaries are the same on all platforms.

I do on my web site, covering different versions of postgresql. However,
someone tried a 1.1 binary on a 1.2 JVM, and it complained. It's more
strict on the class validation.

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



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

From
Herouth Maoz
Date:
At 17:33 +0200 on 30/11/98, Peter T Mount wrote:


> I do on my web site, covering different versions of postgresql. However,
> someone tried a 1.1 binary on a 1.2 JVM, and it complained. It's more
> strict on the class validation.

What I meant was - why not offer the complete bundeled jar (both 1.1 and
1.2, as you suggested) in binary form, and avoid the problem of having to
compile it under two javacs in the target computer. This will force us to
have the two JVMs even if we use onle one... So, do the compilation on your
own set, and distribute the combined Jar. The Jar format itself shouldn't
pose a problem.

Why can you distribute the binaries only from your web site? Any reason you
can't put them in the CVS? Say, in text-encoded format, with the makefile
merely doing the decoding?

I also wonder how come it's impossible to compile 1.1 code under 1.2...
That doesn't make sense, as far as Sun's policy went so far. Perhaps there
is a 1.1 compatibility flag for the 1.2 javac?

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma



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

From
Peter T Mount
Date:
On Mon, 30 Nov 1998, Herouth Maoz wrote:

> At 17:33 +0200 on 30/11/98, Peter T Mount wrote:
>
>
> > I do on my web site, covering different versions of postgresql. However,
> > someone tried a 1.1 binary on a 1.2 JVM, and it complained. It's more
> > strict on the class validation.
>
> What I meant was - why not offer the complete bundeled jar (both 1.1 and
> 1.2, as you suggested) in binary form, and avoid the problem of having to
> compile it under two javacs in the target computer. This will force us to
> have the two JVMs even if we use onle one... So, do the compilation on your
> own set, and distribute the combined Jar. The Jar format itself shouldn't
> pose a problem.
>
> Why can you distribute the binaries only from your web site? Any reason you
> can't put them in the CVS? Say, in text-encoded format, with the makefile
> merely doing the decoding?

There's no reason for them not going into CVS. We had this discussion
before about putting the binary in, but decided not to - can't remember
why though.

I put them up on my site because I was getting asked a lot for the
binaries, and I had a small archive of earlier versions, so I put them up.

If everyone feels that a binary should be in CVS, I can build one every
time I post patches.

Marc, what affects would this have to CVS having a binary in the
repository, and how would it affect updating it later on. Would this cause
more grief than is reasonable?

> I also wonder how come it's impossible to compile 1.1 code under 1.2...
> That doesn't make sense, as far as Sun's policy went so far. Perhaps there
> is a 1.1 compatibility flag for the 1.2 javac?

It's not the JVM, but in 1.2, the java.sql package has been expanded, and
most of the interfaces we implement in the driver have themselves been
expanded, so when you compile the current sources under 1.2, it complains
because methods have not been implemented.

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