Thread: JDBC driver
Hi,
I have a problem of building a JDBC driver in LINUX environment.
Postgresql server: 7.4.3
The version of Apache Ant: 1.5.2-23
Linux: 2.4.21-27.0.2.EL #1 Wed Jan 12 23:35:46 EST 2005 i686 athlon i386 GNU/Linux
The version of JDBC driver to be built: 3
Error messages:
*********************************************
Buildfile: ./build.xml
all:
prepare:
check_versions:
check_driver:
driver:
compile:
[javac] Compiling 77 source files to /tmp/jdbc-driver/build
[javac] /tmp/jdbc-driver/org/postgresql/jdbc3/Jdbc3Statement.java:28: error: Invalid checked exception class `java.sql.SQLException' in `throws' clause. The exception must be a subclass of an exception thrown by `org.postgresql.jdbc1.AbstractJdbc1Statement.createRefCursorResultSet(java.lang.String)' from class `org.postgresql.jdbc1.AbstractJdbc1Statement'.
[javac] public PGRefCursorResultSet createRefCursorResultSet (String cursorName) throws SQLException
[javac] ^
[javac] /tmp/jdbc-driver/org/postgresql/jdbc3/Jdbc3PreparedStatement.java:23: error: Invalid checked exception class `java.sql.SQLException' in `throws' clause. The exception must be a subclass of an exception thrown by `org.postgresql.jdbc1.AbstractJdbc1Statement.createRefCursorResultSet(java.lang.String)' from class `org.postgresql.jdbc1.AbstractJdbc1Statement'.
[javac] public PGRefCursorResultSet createRefCursorResultSet (String cursorName) throws SQLException
[javac] ^
[javac] /tmp/jdbc-driver/org/postgresql/jdbc3/Jdbc3PoolingDataSource.java:29: error: Method `org.postgresql.jdbc2.optional.PoolingDataSource.getDataSource(java.lang.String)' was defined with return type `org.postgresql.jdbc2.optional.PoolingDataSource' in class `org.postgresql.jdbc2.optional.PoolingDataSource'.
[javac] static Jdbc3PoolingDataSource getDataSource(String name)
[javac] ^
[javac] /tmp/jdbc-driver/org/postgresql/jdbc3/Jdbc3CallableStatement.java:23: error: Invalid checked exception class `java.sql.SQLException' in `throws' clause. The exception must be a subclass of an exception thrown by `org.postgresql.jdbc1.AbstractJdbc1Statement.createRefCursorResultSet(java.lang.String)' from class `org.postgresql.jdbc1.AbstractJdbc1Statement'.
[javac] public PGRefCursorResultSet createRefCursorResultSet (String cursorName) throws SQLException
[javac] ^
[javac] 4 errors
BUILD FAILED
*****************************************************
Any idea of fixing this?
Thank you for your attention.
Richard
***********************************************************************
Richard Wong
Atlas Centre
Rutherford Appleton Laboratory
Oxfordshire
United Kingdom
OX11 0QX
Telephone: 01235-446075
Email: r.y.m.wong@rl.ac.uk
***********************************************************************
The contents of this email are sent in confidence for the use of the intended recipient only. If you are not one of the intended recipients do not take action on it or show it to anyone else, but return this email to the sender and delete your copy of it.
Wong, RYM (Richard) wrote: > I have a problem of building a JDBC driver in LINUX environment. What version of the driver are you trying to build? -O
Oliver Jowett wrote: > Wong, RYM (Richard) wrote: > >> I have a problem of building a JDBC driver in LINUX environment. > > > What version of the driver are you trying to build? and equally important, what version of the J2SDK is installed? $ java -version java version "1.4.2_04" ...... $ which javac /usr/java/j2sdk1.4.2_04/bin/javac
Wong, RYM (Richard) wrote: > It is part of the postgresql-7.4.3 package. > When I run the config command with the flag '--with-java' and then run 'gmake', the whole > suite of jdbc is generated automatically. > I suppose the full version of jdbc is 7.4.3. Ah, ok. This is very old code. It predates 1.5 and so it's not too suprising that it doesn't build under 1.5. I suggest you build from source available at jdbc.postgresql.org or use a prebuilt jar from the same location. Don't pass --with-java to avoid trying to build the driver provided with 7.4.3 (that flag only triggers the driver build -- it does not change how the server or client utils are built). I'd also suggest you use the latest 7.4.x server, not 7.4.3. There are data-loss bugs that have been fixed since 7.4.3. -O