Re: Is DataSource implemented?

Lists: pgsql-jdbc
From: Larry Mulcahy <lmulcahy(at)qip(dot)qwest(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Is DataSource implemented?
Date: 2001-05-08 23:34:30
Message-ID: 3AF88286.97920722@qip.qwest.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Referring back to
http://fts.postgresql.org/db/mw/msg.html?mid=82946,
I tried to use [org.]postgresql.PostgresqlDataSource
but could not find it in
/usr/local/pgsql/share/java/postgresql.jar, created
today by compiling PostgreSQL 7.1.1 from the sources.

When I list postgresql.jar with
jar tvf /usr/local/pgsql/share/java/postgresql.jar,
it has the other classes that are supposed to be
under org.postgresql:

12171 Tue May 08 15:48:50 MDT 2001 org/postgresql/Connection.class
4332 Tue May 08 15:48:50 MDT 2001 org/postgresql/PG_Stream.class
4204 Tue May 08 15:48:50 MDT 2001 org/postgresql/Driver.class
2836 Tue May 08 15:48:50 MDT 2001 org/postgresql/Field.class
2440 Tue May 08 15:48:50 MDT 2001 org/postgresql/ResultSet.class
347 Tue May 08 15:48:52 MDT 2001 org/postgresql/Statement.class

but not PostgresqlDataSource.

I can see PostgresqlDataSource.java
sitting there in src/interfaces/jdbc/org/postgresql,
but it's not being compiled and finding its way into the
.jar file.

I see in postgresql-7.1.1/src/interfaces/jdbc/Implementation
this provocative hint:

PostgresqlDataSource
Exists in the Java2 Enterprise edition driver only and
is the
enterprise equivalent to Driver

What do I need to do to get the DataSource class? Build
with some J2EE stuff?

--
Larry Mulcahy lmulcahy(at)qip(dot)qwest(dot)net
PGP public key at:
http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=0x2C4C5A03


From: Larry Mulcahy <lmulcahy(at)qip(dot)qwest(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Is DataSource implemented?
Date: 2001-05-09 15:57:46
Message-ID: 3AF968FA.50A64064@qip.qwest.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Never mind, I figured it out.

Ant's build.xml (src/interfaces/jdbc/build.xml) decides whether
to build the 'enterprise' version of postgresql.jar by
checking whether the class javax.sql.DataSource is present.

The solution is to install the J2EE SDK, then make sure
j2ee.jar is in the classpath when ant builds the JDBC driver.

Example, my build script for all of PostgreSQL is now:

#!/bin/sh

CLASSPATH=/usr/local/java/j2sdkee1.2.1/lib/j2ee.jar
export CLASSPATH

make distclean
CC=gcc CXX=g++ CFLAGS=-O2 CXXFLAGS=-O2 \
./configure \
--with-java \
--enable-odbc \
--enable-syslog
make -j 2
make check

Larry Mulcahy wrote:
>
> Referring back to
> http://fts.postgresql.org/db/mw/msg.html?mid=82946,
> I tried to use [org.]postgresql.PostgresqlDataSource
> but could not find it in
> /usr/local/pgsql/share/java/postgresql.jar, created
> today by compiling PostgreSQL 7.1.1 from the sources.
>
> When I list postgresql.jar with
> jar tvf /usr/local/pgsql/share/java/postgresql.jar,
> it has the other classes that are supposed to be
> under org.postgresql:
>
> 12171 Tue May 08 15:48:50 MDT 2001 org/postgresql/Connection.class
> 4332 Tue May 08 15:48:50 MDT 2001 org/postgresql/PG_Stream.class
> 4204 Tue May 08 15:48:50 MDT 2001 org/postgresql/Driver.class
> 2836 Tue May 08 15:48:50 MDT 2001 org/postgresql/Field.class
> 2440 Tue May 08 15:48:50 MDT 2001 org/postgresql/ResultSet.class
> 347 Tue May 08 15:48:52 MDT 2001 org/postgresql/Statement.class
>
> but not PostgresqlDataSource.
>
> I can see PostgresqlDataSource.java
> sitting there in src/interfaces/jdbc/org/postgresql,
> but it's not being compiled and finding its way into the
> .jar file.
>
> I see in postgresql-7.1.1/src/interfaces/jdbc/Implementation
> this provocative hint:
>
> PostgresqlDataSource
> Exists in the Java2 Enterprise edition driver only and
> is the
> enterprise equivalent to Driver
>
> What do I need to do to get the DataSource class? Build
> with some J2EE stuff?

--
Larry Mulcahy lmulcahy(at)qip(dot)qwest(dot)net
PGP public key at:
http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=0x2C4C5A03


From: Peter Mount <peter(at)retep(dot)org(dot)uk>
To: Larry Mulcahy <lmulcahy(at)qip(dot)qwest(dot)net>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Is DataSource implemented?
Date: 2001-05-09 16:23:28
Message-ID: 5.0.2.1.0.20010509172237.01d42920@mail.retep.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

At 09:57 09/05/01 -0600, Larry Mulcahy wrote:
>Never mind, I figured it out.
>
>Ant's build.xml (src/interfaces/jdbc/build.xml) decides whether
>to build the 'enterprise' version of postgresql.jar by
>checking whether the class javax.sql.DataSource is present.
>
>The solution is to install the J2EE SDK, then make sure
>j2ee.jar is in the classpath when ant builds the JDBC driver.

Correct. J2EE is only an extension to J2SE.

Peter