Thread: Compile failure in CVS
I am seeing the following jdbc compile errors in current CVS. I am running: $ java -version java version "donn:01.02.00-14:56" Classic VM (build donn:01.02.00-14:56, native threads, nojit) Any ideas on a fix? -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026 gmake[3]: Leaving directory `/usr/var/local/src/gen/pgsql/CURRENT/pgsql/src/interfaces/python' gmake[3]: Entering directory `/usr/var/local/src/gen/pgsql/CURRENT/pgsql/src/interfaces/jdbc' /usr/local/bin/ant -buildfile ./build.xml all \ -Dmajor=7 -Dminor=3 -Dfullversion=7.3devel -Ddef_pgport=5432 -Denable_debug=no Buildfile: ./build.xml all: prepare: check_versions: driver: [echo] Configured build for the JDBC2 edition driver compile: [javac] Compiling 5 source files to /usr/var/local/src/gen/pgsql/CURRENT/pgsql/src/interfaces/jdbc/build [javac] /usr/var/local/src/gen/pgsql/CURRENT/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java:13: Themethod org.postgresql.jdbc2.Statement getStatement() declared in class org.postgresql.jdbc2.AbstractJdbc2ResultSet cannotoverride the method of the same signature declared in interface java.sql.ResultSet. They must have the same returntype. [javac] public class Jdbc2ResultSet extends org.postgresql.jdbc2.AbstractJdbc2ResultSet implements java.sql.ResultSet [javac] ^ [javac] /usr/var/local/src/gen/pgsql/CURRENT/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java:49: Invalid castfrom org.postgresql.jdbc2.ResultSet to org.postgresql.jdbc2.AbstractJdbc2ResultSet. [javac] this.rawString = ((AbstractJdbc2ResultSet)rs).getFixedString(idx); [javac] ^ [javac] /usr/var/local/src/gen/pgsql/CURRENT/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2Connection.java:14:class org.postgresql.jdbc2.Jdbc2Connectionmust be declared abstract. It does not define java.sql.ResultSet getResultSet(java.sql.Statement,org.postgresql.Field[], java.util.Vector, java.lang.String, int) from class org.postgresql.jdbc1.AbstractJdbc1Connection. [javac] public class Jdbc2Connection extends org.postgresql.jdbc2.AbstractJdbc2Connection implements java.sql.Connection [javac] ^ [javac] /usr/var/local/src/gen/pgsql/CURRENT/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2Connection.java:14:class org.postgresql.jdbc2.Jdbc2Connectionmust be declared abstract. It does not define java.sql.ResultSet getResultSet(java.sql.Statement,org.postgresql.Field[], java.util.Vector, java.lang.String, int, long, boolean) from classorg.postgresql.jdbc1.AbstractJdbc1Connection. [javac] public class Jdbc2Connection extends org.postgresql.jdbc2.AbstractJdbc2Connection implements java.sql.Connection [javac] ^ [javac] /usr/var/local/src/gen/pgsql/CURRENT/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:221: Incompatibletype for constructor. Explicit cast needed to convert java.sql.ResultSet to org.postgresql.jdbc2.ResultSet. [javac] return (java.sql.Array) new org.postgresql.jdbc2.Array( connection, i, fields[i - 1], (java.sql.ResultSet)this ); [javac] ^ [javac] /usr/var/local/src/gen/pgsql/CURRENT/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:382: Incompatibletype for return. Explicit cast needed to convert java.sql.Statement to org.postgresql.jdbc2.Statement. [javac] return statement; [javac] ^ [javac] /usr/var/local/src/gen/pgsql/CURRENT/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:499: Incompatibletype for =. Explicit cast needed to convert java.sql.PreparedStatement to org.postgresql.jdbc2.PreparedStatement. [javac] deleteStatement = ((java.sql.Connection) connection).prepareStatement(deleteSQL.toString()); [javac] ^ [javac] /usr/var/local/src/gen/pgsql/CURRENT/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:549: Incompatibletype for =. Explicit cast needed to convert java.sql.PreparedStatement to org.postgresql.jdbc2.PreparedStatement. [javac] insertStatement = ((java.sql.Connection) connection).prepareStatement(insertSQL.toString()); [javac] ^ [javac] /usr/var/local/src/gen/pgsql/CURRENT/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:563: Invalidcast from org.postgresql.jdbc2.PreparedStatement to org.postgresql.jdbc2.AbstractJdbc2Statement. [javac] long insertedOID = ((AbstractJdbc2Statement) insertStatement).getLastOID(); [javac] ^ [javac] /usr/var/local/src/gen/pgsql/CURRENT/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:915: Incompatibletype for =. Explicit cast needed to convert java.sql.PreparedStatement to org.postgresql.jdbc2.PreparedStatement. [javac] selectStatement = ((java.sql.Connection) connection).prepareStatement(selectSQL.toString()); [javac] ^ [javac] /usr/var/local/src/gen/pgsql/CURRENT/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:983: Incompatibletype for =. Explicit cast needed to convert java.sql.PreparedStatement to org.postgresql.jdbc2.PreparedStatement. [javac] updateStatement = ((java.sql.Connection) connection).prepareStatement(updateSQL.toString()); [javac] ^ [javac] /usr/var/local/src/gen/pgsql/CURRENT/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java:51: Invalidcast from org.postgresql.jdbc2.AbstractJdbc2Statement to org.postgresql.jdbc2.Statement. [javac] ((AbstractJdbc2ResultSet)result).setStatement((Statement)this); [javac] ^ [javac] 12 errors BUILD FAILED /usr/var/local/src/gen/pgsql/CURRENT/pgsql/src/interfaces/jdbc/./build.xml:85: Compile failed, messages should have beenprovided. Total time: 9 seconds
Monday 29 July 2002 04:55, Bruce Momjian wrote: > I am seeing the following jdbc compile errors in current CVS. I am > running: [...] Which Java version (1.3 or 1.4) are you using? There are some differences in the SQL stuff. There are at least some code related issues as well, e.g. in the source code class _org.postgresql.jdbc2.Statement_ returned by the getStatement() declared in class org.postgresql.jdbc2.AbstractJdbc2ResultSet (see the first error) does not exist. However, _org.postgresql.jdbc2.Jdbc2Statement_ does. Somebody not compiling their code before committing? :-) Yours, Haakon Hansen Norway
Bruce, Try getting a fresh copy, Barry did a very large rewrite to prepare for jdbc3 and removed alot of files. I can compile clean. Dave On Mon, 2002-07-29 at 03:24, Håkon Hansen wrote: > Monday 29 July 2002 04:55, Bruce Momjian wrote: > > I am seeing the following jdbc compile errors in current CVS. I am > > running: > > [...] > > Which Java version (1.3 or 1.4) are you using? There are some differences in > the SQL stuff. > > There are at least some code related issues as well, e.g. in the source code > class _org.postgresql.jdbc2.Statement_ returned by the getStatement() declared > in class org.postgresql.jdbc2.AbstractJdbc2ResultSet (see the first error) > does not exist. > > However, _org.postgresql.jdbc2.Jdbc2Statement_ does. > > Somebody not compiling their code before committing? :-) > > > Yours, > > Haakon Hansen > Norway > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html > >
Monday 29 July 2002 11:17, skrev Dave Cramer: > Bruce, > > Try getting a fresh copy, Barry did a very large rewrite to prepare for > jdbc3 and removed alot of files. I can compile clean. What does this rewrite do (or solve)? I thought JDBC3, which is suppoded to be included in J2SE 1.4, would be supported by the pgjdbc2.jar driver. At least, the comment next to the download link says that JDK 1.4 is supported ... (And Dave: Might this have something to do with my connection problem?) Yours, Haakon Hansen Norway
Haakon, First a little background/history when jdk1.1 came out java.sql.* was implemented in the org.postgresql.jdbc1 package. Probably not packaged this way at the time, but it is before my time so I am guessing. Then jdk1.2 came out and this required a seperation of the packages; primarily because of additional Types in java.sql.Types. They couldn't be referenced in the jdbc1 package because they didn't exist in it. So it looks like the orignal people who did the jdbc2 version simply copied the jdbc1 stuff, repackaged it into jdbc2 and added the methods etc. Along they way they started using some jdbc2 specific methods such as the Collections package. The challenge was that there was alot of duplicate code shared between the packages, which meant that an update in one required an update in the other ....this was tolerable with only two packages to deal with, now we have jdbc3 and presumable we can expect 4, 5, .... etc. So the rewrite solves the problem of duplicate code shared between the two versions of jdbc1,jdbc2, and now jdbc3. We will have to implement the new methods in the jdbc3 spec. Dave On Mon, 2002-07-29 at 05:38, Håkon Hansen wrote: > Monday 29 July 2002 11:17, skrev Dave Cramer: > > Bruce, > > > > Try getting a fresh copy, Barry did a very large rewrite to prepare for > > jdbc3 and removed alot of files. I can compile clean. > > What does this rewrite do (or solve)? I thought JDBC3, which is suppoded to be > included in J2SE 1.4, would be supported by the pgjdbc2.jar driver. At least, > the comment next to the download link says that JDK 1.4 is supported ... > > (And Dave: Might this have something to do with my connection problem?) > > > Yours, > > Haakon Hansen > Norway > >
Haakon, To answer your other question, jdk1.4 is supported, jdbc3 is not. In otherwords the code will run under jdk1.4 as long as you don't call any of the jdbc3 specific methods. I doubt that it is related to your connection problem. People tell me that it runs under jdk1.4 Dave On Mon, 2002-07-29 at 05:52, Dave Cramer wrote: > Haakon, > > First a little background/history > > when jdk1.1 came out java.sql.* was implemented in the > org.postgresql.jdbc1 package. Probably not packaged this way at the > time, but it is before my time so I am guessing. > > Then jdk1.2 came out and this required a seperation of the packages; > primarily because of additional Types in java.sql.Types. They couldn't > be referenced in the jdbc1 package because they didn't exist in it. > > So it looks like the orignal people who did the jdbc2 version simply > copied the jdbc1 stuff, repackaged it into jdbc2 and added the methods > etc. Along they way they started using some jdbc2 specific methods such > as the Collections package. The challenge was that there was alot of > duplicate code shared between the packages, which meant that an update > in one required an update in the other ....this was tolerable with only > two packages to deal with, now we have jdbc3 and presumable we can > expect 4, 5, .... etc. > > So the rewrite solves the problem of duplicate code shared between the > two versions of jdbc1,jdbc2, and now jdbc3. > > > We will have to implement the new methods in the jdbc3 spec. > > Dave > > > On Mon, 2002-07-29 at 05:38, Håkon Hansen wrote: > > Monday 29 July 2002 11:17, skrev Dave Cramer: > > > Bruce, > > > > > > Try getting a fresh copy, Barry did a very large rewrite to prepare for > > > jdbc3 and removed alot of files. I can compile clean. > > > > What does this rewrite do (or solve)? I thought JDBC3, which is suppoded to be > > included in J2SE 1.4, would be supported by the pgjdbc2.jar driver. At least, > > the comment next to the download link says that JDK 1.4 is supported ... > > > > (And Dave: Might this have something to do with my connection problem?) > > > > > > Yours, > > > > Haakon Hansen > > Norway > > > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > >
Dave Cramer wrote: > Haakon, > > First a little background/history > > when jdk1.1 came out java.sql.* was implemented in the > org.postgresql.jdbc1 package. Probably not packaged this way at the > time, but it is before my time so I am guessing. > > Then jdk1.2 came out and this required a seperation of the packages; > primarily because of additional Types in java.sql.Types. They couldn't > be referenced in the jdbc1 package because they didn't exist in it. > > So it looks like the orignal people who did the jdbc2 version simply > copied the jdbc1 stuff, repackaged it into jdbc2 and added the methods > etc. Along they way they started using some jdbc2 specific methods such > as the Collections package. The challenge was that there was alot of > duplicate code shared between the packages, which meant that an update > in one required an update in the other ....this was tolerable with only > two packages to deal with, now we have jdbc3 and presumable we can > expect 4, 5, .... etc. > > So the rewrite solves the problem of duplicate code shared between the > two versions of jdbc1,jdbc2, and now jdbc3. Yes, those separate directories with mostly duplicate code was a maintenance headache. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026