Thread: more insertRow() bugs and fixes
First, a big thanks to Dave Cramer for working with me on the last insertRow() issue I had--the patch works wonderfully!
Now, on to the next few things.
1. When you insert a row into a resultset that has no rows and then call moveToCurrentRow(), you get a null pointer exception. Example code:
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
ResultSet uprs = stmt.executeQuery("SELECT oid,* FROM school WHERE 1=0");
uprs.moveToInsertRow();
uprs.updateString("name", name);
uprs.insertRow();
uprs.moveToCurrentRow();
java.lang.ArrayIndexOutOfBoundsException: -1 < 0
at java.util.Vector.elementAt(Vector.java:437)
at org.postgresql.jdbc2.AbstractJdbc2ResultSet.moveToCurrentRow(AbstractJdbc2ResultSet.java:667)
The cause of this is pretty straightforward. The offending line 667 in AbstractJdbc2ResultSet.java is:
this_row = (byte[][]) rows.elementAt(current_row);
current_row is -1 because the current position is before any rows.
2. After moving onto the insert row, only a few of the resultset cursor-moving functions clear the internal “onInsertRow” variable. According to http://java.sun.com/docs/books/tutorial/jdbc/jdbc2dot0/inserting.html :
“After you have called the method insertRow , you can start building another row to be inserted, or you can move the cursor back to a result set row. You can, for instance, invoke any of the methods that put the cursor on a specific row, such as first , last , beforeFirst , afterLast , and absolute . You can also use the methods previous , relative , and moveToCurrentRow.”
However, in the current driver, only first() and moveToCurrentRow() clear the onInsertRow flag. This causes problems when you later try to update a row in the same resultset. The functions that need to be modified that come to mind are: last(), beforeFirst(), afterLast(), absolute(), previous(), next(), and relative() (relative() uses absolute() internally, so I’ve skipped putting any code in it).
I’ve included a patch to address these issues, but I’m still new to the codebase (and my directory isn’t set up to compile), so it’ll need a good looking-over.
Thanks again,
Joel
Attachment
I cannot build the driver from current CVS sources. Any suggestions? thanks. adler@vision2:~/work/pgsql/src/interfaces/jdbc$ cvs update -CAPd && make clean && make ? build ? build.properties ? jars ? typescript ? org/postgresql/Driver.java cvs server: Updating . cvs server: Updating example cvs server: Updating example/corba cvs server: Updating org cvs server: Updating org/postgresql cvs server: Updating org/postgresql/core cvs server: Updating org/postgresql/fastpath cvs server: Updating org/postgresql/geometric cvs server: Updating org/postgresql/jdbc1 cvs server: Updating org/postgresql/jdbc2 cvs server: Updating org/postgresql/jdbc2/optional cvs server: Updating org/postgresql/jdbc3 cvs server: Updating org/postgresql/largeobject cvs server: Updating org/postgresql/test cvs server: Updating org/postgresql/test/jdbc2 cvs server: Updating org/postgresql/test/jdbc2/optional cvs server: Updating org/postgresql/test/jdbc3 cvs server: Updating org/postgresql/test/util cvs server: Updating org/postgresql/util cvs server: Updating org/postgresql/xa cvs server: Updating postgresql cvs server: Updating postgresql/fastpath cvs server: Updating postgresql/geometric cvs server: Updating postgresql/jdbc1 cvs server: Updating postgresql/jdbc2 cvs server: Updating postgresql/largeobject cvs server: Updating postgresql/util cvs server: Updating utils /usr/bin/ant -buildfile ./build.xml clean_all Buildfile: ./build.xml clean: [delete] Deleting directory /home/adler/work/pgsql/src/interfaces/jdbc/build [delete] Deleting directory /home/adler/work/pgsql/src/interfaces/jdbc/jars [delete] Deleting: /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/Driver.java clean_all: [delete] Deleting: /home/adler/work/pgsql/src/interfaces/jdbc/build.properties BUILD SUCCESSFUL Total time: 2 seconds echo "# This file was created by 'make build.properties'." > build.properties echo major=7 >> build.properties echo minor=4 >> build.properties echo fullversion=7.4devel >> build.properties echo def_pgport=5432 >> build.properties echo enable_debug=no >> build.properties /usr/bin/ant -buildfile ./build.xml all Buildfile: ./build.xml all: prepare: [mkdir] Created dir: /home/adler/work/pgsql/src/interfaces/jdbc/build [mkdir] Created dir: /home/adler/work/pgsql/src/interfaces/jdbc/jars check_versions: check_driver: driver: [copy] Copying 1 file to /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql [echo] Configured build for the JDBC2 edition driver compile: [javac] Compiling 56 source files to /home/adler/work/pgsql/src/interfaces/jdbc/build [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java:26: reference to ResultSetis ambiguous, both class org.postgresql.ResultSet in org.postgresql and class java.sql.ResultSet in java.sql match [javac] public static ResultSet execute (String[] p_sqlFrags, [javac] ^ [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:239: cannot resolvesymbol [javac] symbol : constructor Array (org.postgresql.PGConnection,int,org.postgresql.Field,java.sql.ResultSet) [javac] location: class org.postgresql.jdbc2.Array [javac] return (java.sql.Array) new org.postgresql.jdbc2.Array( connection, i, fields[i - 1], (java.sql.ResultSet)this ); [javac] ^ [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:417: incompatibletypes [javac] found : java.sql.Statement [javac] required: org.postgresql.jdbc2.Statement [javac] return statement; [javac] ^ [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:557: incompatibletypes [javac] found : java.sql.PreparedStatement [javac] required: org.postgresql.jdbc2.PreparedStatement [javac] deleteStatement = ((java.sql.Connection) connection).prepareStatement(deleteSQL.toString()); [javac] ^ [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:616: incompatibletypes [javac] found : java.sql.PreparedStatement [javac] required: org.postgresql.jdbc2.PreparedStatement [javac] insertStatement = ((java.sql.Connection) connection).prepareStatement(insertSQL.toString()); [javac] ^ [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:636: inconvertibletypes [javac] found : org.postgresql.jdbc2.PreparedStatement [javac] required: org.postgresql.jdbc2.AbstractJdbc2Statement [javac] long insertedOID = ((AbstractJdbc2Statement) insertStatement).getLastOID(); [javac] ^ [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:950: incompatibletypes [javac] found : java.sql.PreparedStatement [javac] required: org.postgresql.jdbc2.PreparedStatement [javac] selectStatement = ((java.sql.Connection) connection).prepareStatement(selectSQL.toString()); [javac] ^ [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1038: incompatibletypes [javac] found : java.sql.PreparedStatement [javac] required: org.postgresql.jdbc2.PreparedStatement [javac] updateStatement = ((java.sql.Connection) connection).prepareStatement(updateSQL.toString()); [javac] ^ [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java:51: inconvertibletypes [javac] found : org.postgresql.jdbc2.AbstractJdbc2Statement [javac] required: org.postgresql.jdbc2.Statement [javac] ((AbstractJdbc2ResultSet)result).setStatement((Statement)this); [javac] ^ [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java:49: inconvertible types [javac] found : org.postgresql.jdbc2.ResultSet [javac] required: org.postgresql.jdbc2.AbstractJdbc2ResultSet [javac] this.rawString = ((AbstractJdbc2ResultSet)rs).getFixedString(idx); [javac] ^ [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2CallableStatement.java:16: cannot resolvesymbol [javac] symbol : constructor Jdbc2ResultSet (org.postgresql.jdbc2.Jdbc2CallableStatement,org.postgresql.Field[],java.util.Vector,java.lang.String,int,long,boolean) [javac] location: class org.postgresql.jdbc2.Jdbc2ResultSet [javac] return new Jdbc2ResultSet(this, fields, tuples, status, updateCount, insertOID, binaryCursor); [javac] ^ [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2PreparedStatement.java:16: cannot resolvesymbol [javac] symbol : constructor Jdbc2ResultSet (org.postgresql.jdbc2.Jdbc2PreparedStatement,org.postgresql.Field[],java.util.Vector,java.lang.String,int,long,boolean) [javac] location: class org.postgresql.jdbc2.Jdbc2ResultSet [javac] return new Jdbc2ResultSet(this, fields, tuples, status, updateCount, insertOID, binaryCursor); [javac] ^ [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java:13: getStatement() in org.postgresql.jdbc2.AbstractJdbc2ResultSetcannot implement getStatement() in java.sql.ResultSet; attempting to use incompatiblereturn type [javac] found : org.postgresql.jdbc2.Statement [javac] required: java.sql.Statement [javac] public class Jdbc2ResultSet extends org.postgresql.jdbc2.AbstractJdbc2ResultSet implements java.sql.ResultSet [javac] ^ [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2Statement.java:21: cannot resolve symbol [javac] symbol : constructor Jdbc2ResultSet (org.postgresql.jdbc2.Jdbc2Statement,org.postgresql.Field[],java.util.Vector,java.lang.String,int,long,boolean) [javac] location: class org.postgresql.jdbc2.Jdbc2ResultSet [javac] return new Jdbc2ResultSet(this, fields, tuples, status, updateCount, insertOID, binaryCursor); [javac] ^ [javac] Note: Some input files use or override a deprecated API. [javac] Note: Recompile with -deprecation for details. [javac] 14 errors BUILD FAILED file:/home/adler/work/pgsql/src/interfaces/jdbc/build.xml:106: Compile failed; see the compiler error output for details. Total time: 5 seconds make: *** [all] Error 1 adler@vision2:~/work/pgsql/src/interfaces/jdbc$ ant -version Apache Ant version 1.5.1 compiled on October 23 2002 adler@vision2:~/work/pgsql/src/interfaces/jdbc$ adler@vision2:~/work/pgsql/src/interfaces/jdbc$ java -version java version "1.3.1" Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.3.1-02b-FCS) Java HotSpot(TM) Client VM (build Blackdown-1.3.1_02b-FCS, mixed mode)
Michael, Do you have an old postgres.jar in the classpath somewhere? DAve On Tue, 2003-02-04 at 21:07, Michael Adler wrote: > I cannot build the driver from current CVS sources. Any suggestions? > > thanks. > > > > > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ cvs update -CAPd && make clean && make > ? build > ? build.properties > ? jars > ? typescript > ? org/postgresql/Driver.java > cvs server: Updating . > cvs server: Updating example > cvs server: Updating example/corba > cvs server: Updating org > cvs server: Updating org/postgresql > cvs server: Updating org/postgresql/core > cvs server: Updating org/postgresql/fastpath > cvs server: Updating org/postgresql/geometric > cvs server: Updating org/postgresql/jdbc1 > cvs server: Updating org/postgresql/jdbc2 > cvs server: Updating org/postgresql/jdbc2/optional > cvs server: Updating org/postgresql/jdbc3 > cvs server: Updating org/postgresql/largeobject > cvs server: Updating org/postgresql/test > cvs server: Updating org/postgresql/test/jdbc2 > cvs server: Updating org/postgresql/test/jdbc2/optional > cvs server: Updating org/postgresql/test/jdbc3 > cvs server: Updating org/postgresql/test/util > cvs server: Updating org/postgresql/util > cvs server: Updating org/postgresql/xa > cvs server: Updating postgresql > cvs server: Updating postgresql/fastpath > cvs server: Updating postgresql/geometric > cvs server: Updating postgresql/jdbc1 > cvs server: Updating postgresql/jdbc2 > cvs server: Updating postgresql/largeobject > cvs server: Updating postgresql/util > cvs server: Updating utils > /usr/bin/ant -buildfile ./build.xml clean_all > Buildfile: ./build.xml > > clean: > [delete] Deleting directory /home/adler/work/pgsql/src/interfaces/jdbc/build > [delete] Deleting directory /home/adler/work/pgsql/src/interfaces/jdbc/jars > [delete] Deleting: /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/Driver.java > > clean_all: > [delete] Deleting: /home/adler/work/pgsql/src/interfaces/jdbc/build.properties > > BUILD SUCCESSFUL > Total time: 2 seconds > echo "# This file was created by 'make build.properties'." > build.properties > echo major=7 >> build.properties > echo minor=4 >> build.properties > echo fullversion=7.4devel >> build.properties > echo def_pgport=5432 >> build.properties > echo enable_debug=no >> build.properties > /usr/bin/ant -buildfile ./build.xml all > Buildfile: ./build.xml > > all: > > prepare: > [mkdir] Created dir: /home/adler/work/pgsql/src/interfaces/jdbc/build > [mkdir] Created dir: /home/adler/work/pgsql/src/interfaces/jdbc/jars > > check_versions: > > check_driver: > > driver: > [copy] Copying 1 file to /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql > [echo] Configured build for the JDBC2 edition driver > > compile: > [javac] Compiling 56 source files to /home/adler/work/pgsql/src/interfaces/jdbc/build > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java:26: reference to ResultSetis ambiguous, both class org.postgresql.ResultSet in org.postgresql and class java.sql.ResultSet in java.sql match > [javac] public static ResultSet execute (String[] p_sqlFrags, > [javac] ^ > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:239: cannot resolvesymbol > [javac] symbol : constructor Array (org.postgresql.PGConnection,int,org.postgresql.Field,java.sql.ResultSet) > [javac] location: class org.postgresql.jdbc2.Array > [javac] return (java.sql.Array) new org.postgresql.jdbc2.Array( connection, i, fields[i - 1], (java.sql.ResultSet)this ); > [javac] ^ > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:417: incompatibletypes > [javac] found : java.sql.Statement > [javac] required: org.postgresql.jdbc2.Statement > [javac] return statement; > [javac] ^ > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:557: incompatibletypes > [javac] found : java.sql.PreparedStatement > [javac] required: org.postgresql.jdbc2.PreparedStatement > [javac] deleteStatement = ((java.sql.Connection) connection).prepareStatement(deleteSQL.toString()); > [javac] ^ > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:616: incompatibletypes > [javac] found : java.sql.PreparedStatement > [javac] required: org.postgresql.jdbc2.PreparedStatement > [javac] insertStatement = ((java.sql.Connection) connection).prepareStatement(insertSQL.toString()); > [javac] ^ > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:636: inconvertibletypes > [javac] found : org.postgresql.jdbc2.PreparedStatement > [javac] required: org.postgresql.jdbc2.AbstractJdbc2Statement > [javac] long insertedOID = ((AbstractJdbc2Statement) insertStatement).getLastOID(); > [javac] ^ > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:950: incompatibletypes > [javac] found : java.sql.PreparedStatement > [javac] required: org.postgresql.jdbc2.PreparedStatement > [javac] selectStatement = ((java.sql.Connection) connection).prepareStatement(selectSQL.toString()); > [javac] ^ > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1038: incompatibletypes > [javac] found : java.sql.PreparedStatement > [javac] required: org.postgresql.jdbc2.PreparedStatement > [javac] updateStatement = ((java.sql.Connection) connection).prepareStatement(updateSQL.toString()); > [javac] ^ > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java:51: inconvertibletypes > [javac] found : org.postgresql.jdbc2.AbstractJdbc2Statement > [javac] required: org.postgresql.jdbc2.Statement > [javac] ((AbstractJdbc2ResultSet)result).setStatement((Statement)this); > [javac] ^ > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java:49: inconvertible types > [javac] found : org.postgresql.jdbc2.ResultSet > [javac] required: org.postgresql.jdbc2.AbstractJdbc2ResultSet > [javac] this.rawString = ((AbstractJdbc2ResultSet)rs).getFixedString(idx); > [javac] ^ > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2CallableStatement.java:16: cannot resolvesymbol > [javac] symbol : constructor Jdbc2ResultSet (org.postgresql.jdbc2.Jdbc2CallableStatement,org.postgresql.Field[],java.util.Vector,java.lang.String,int,long,boolean) > [javac] location: class org.postgresql.jdbc2.Jdbc2ResultSet > [javac] return new Jdbc2ResultSet(this, fields, tuples, status, updateCount, insertOID, binaryCursor); > [javac] ^ > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2PreparedStatement.java:16: cannot resolvesymbol > [javac] symbol : constructor Jdbc2ResultSet (org.postgresql.jdbc2.Jdbc2PreparedStatement,org.postgresql.Field[],java.util.Vector,java.lang.String,int,long,boolean) > [javac] location: class org.postgresql.jdbc2.Jdbc2ResultSet > [javac] return new Jdbc2ResultSet(this, fields, tuples, status, updateCount, insertOID, binaryCursor); > [javac] ^ > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java:13: getStatement() in org.postgresql.jdbc2.AbstractJdbc2ResultSetcannot implement getStatement() in java.sql.ResultSet; attempting to use incompatiblereturn type > [javac] found : org.postgresql.jdbc2.Statement > [javac] required: java.sql.Statement > [javac] public class Jdbc2ResultSet extends org.postgresql.jdbc2.AbstractJdbc2ResultSet implements java.sql.ResultSet > [javac] ^ > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2Statement.java:21: cannot resolve symbol > [javac] symbol : constructor Jdbc2ResultSet (org.postgresql.jdbc2.Jdbc2Statement,org.postgresql.Field[],java.util.Vector,java.lang.String,int,long,boolean) > [javac] location: class org.postgresql.jdbc2.Jdbc2ResultSet > [javac] return new Jdbc2ResultSet(this, fields, tuples, status, updateCount, insertOID, binaryCursor); > [javac] ^ > [javac] Note: Some input files use or override a deprecated API. > [javac] Note: Recompile with -deprecation for details. > [javac] 14 errors > > BUILD FAILED > file:/home/adler/work/pgsql/src/interfaces/jdbc/build.xml:106: Compile failed; see the compiler error output for details. > > Total time: 5 seconds > make: *** [all] Error 1 > > > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ ant -version > Apache Ant version 1.5.1 compiled on October 23 2002 > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ java -version > java version "1.3.1" > Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.3.1-02b-FCS) > Java HotSpot(TM) Client VM (build Blackdown-1.3.1_02b-FCS, mixed mode) > > > ---------------------------(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 <Dave@micro-automation.net>
Yes I did. Pretty good service for 9pm. Thanks. On Tue, 4 Feb 2003, Dave Cramer wrote: > Date: 04 Feb 2003 21:14:11 -0500 > From: Dave Cramer <Dave@micro-automation.net> > To: Michael Adler <adler@glimpser.org> > Cc: "pgsql-jdbc@postgresql.org" <pgsql-jdbc@postgresql.org> > Subject: Re: [JDBC] cannot build current cvs > > Michael, > > Do you have an old postgres.jar in the classpath somewhere? > > DAve > On Tue, 2003-02-04 at 21:07, Michael Adler wrote: > > I cannot build the driver from current CVS sources. Any suggestions? > > > > thanks. > > > > > > > > > > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ cvs update -CAPd && make clean && make > > ? build > > ? build.properties > > ? jars > > ? typescript > > ? org/postgresql/Driver.java > > cvs server: Updating . > > cvs server: Updating example > > cvs server: Updating example/corba > > cvs server: Updating org > > cvs server: Updating org/postgresql > > cvs server: Updating org/postgresql/core > > cvs server: Updating org/postgresql/fastpath > > cvs server: Updating org/postgresql/geometric > > cvs server: Updating org/postgresql/jdbc1 > > cvs server: Updating org/postgresql/jdbc2 > > cvs server: Updating org/postgresql/jdbc2/optional > > cvs server: Updating org/postgresql/jdbc3 > > cvs server: Updating org/postgresql/largeobject > > cvs server: Updating org/postgresql/test > > cvs server: Updating org/postgresql/test/jdbc2 > > cvs server: Updating org/postgresql/test/jdbc2/optional > > cvs server: Updating org/postgresql/test/jdbc3 > > cvs server: Updating org/postgresql/test/util > > cvs server: Updating org/postgresql/util > > cvs server: Updating org/postgresql/xa > > cvs server: Updating postgresql > > cvs server: Updating postgresql/fastpath > > cvs server: Updating postgresql/geometric > > cvs server: Updating postgresql/jdbc1 > > cvs server: Updating postgresql/jdbc2 > > cvs server: Updating postgresql/largeobject > > cvs server: Updating postgresql/util > > cvs server: Updating utils > > /usr/bin/ant -buildfile ./build.xml clean_all > > Buildfile: ./build.xml > > > > clean: > > [delete] Deleting directory /home/adler/work/pgsql/src/interfaces/jdbc/build > > [delete] Deleting directory /home/adler/work/pgsql/src/interfaces/jdbc/jars > > [delete] Deleting: /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/Driver.java > > > > clean_all: > > [delete] Deleting: /home/adler/work/pgsql/src/interfaces/jdbc/build.properties > > > > BUILD SUCCESSFUL > > Total time: 2 seconds > > echo "# This file was created by 'make build.properties'." > build.properties > > echo major=7 >> build.properties > > echo minor=4 >> build.properties > > echo fullversion=7.4devel >> build.properties > > echo def_pgport=5432 >> build.properties > > echo enable_debug=no >> build.properties > > /usr/bin/ant -buildfile ./build.xml all > > Buildfile: ./build.xml > > > > all: > > > > prepare: > > [mkdir] Created dir: /home/adler/work/pgsql/src/interfaces/jdbc/build > > [mkdir] Created dir: /home/adler/work/pgsql/src/interfaces/jdbc/jars > > > > check_versions: > > > > check_driver: > > > > driver: > > [copy] Copying 1 file to /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql > > [echo] Configured build for the JDBC2 edition driver > > > > compile: > > [javac] Compiling 56 source files to /home/adler/work/pgsql/src/interfaces/jdbc/build > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java:26: reference to ResultSetis ambiguous, both class org.postgresql.ResultSet in org.postgresql and class java.sql.ResultSet in java.sql match > > [javac] public static ResultSet execute (String[] p_sqlFrags, > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:239: cannot resolvesymbol > > [javac] symbol : constructor Array (org.postgresql.PGConnection,int,org.postgresql.Field,java.sql.ResultSet) > > [javac] location: class org.postgresql.jdbc2.Array > > [javac] return (java.sql.Array) new org.postgresql.jdbc2.Array( connection, i, fields[i - 1], (java.sql.ResultSet)this ); > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:417: incompatibletypes > > [javac] found : java.sql.Statement > > [javac] required: org.postgresql.jdbc2.Statement > > [javac] return statement; > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:557: incompatibletypes > > [javac] found : java.sql.PreparedStatement > > [javac] required: org.postgresql.jdbc2.PreparedStatement > > [javac] deleteStatement = ((java.sql.Connection) connection).prepareStatement(deleteSQL.toString()); > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:616: incompatibletypes > > [javac] found : java.sql.PreparedStatement > > [javac] required: org.postgresql.jdbc2.PreparedStatement > > [javac] insertStatement = ((java.sql.Connection) connection).prepareStatement(insertSQL.toString()); > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:636: inconvertibletypes > > [javac] found : org.postgresql.jdbc2.PreparedStatement > > [javac] required: org.postgresql.jdbc2.AbstractJdbc2Statement > > [javac] long insertedOID = ((AbstractJdbc2Statement) insertStatement).getLastOID(); > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:950: incompatibletypes > > [javac] found : java.sql.PreparedStatement > > [javac] required: org.postgresql.jdbc2.PreparedStatement > > [javac] selectStatement = ((java.sql.Connection) connection).prepareStatement(selectSQL.toString()); > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1038: incompatibletypes > > [javac] found : java.sql.PreparedStatement > > [javac] required: org.postgresql.jdbc2.PreparedStatement > > [javac] updateStatement = ((java.sql.Connection) connection).prepareStatement(updateSQL.toString()); > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java:51: inconvertibletypes > > [javac] found : org.postgresql.jdbc2.AbstractJdbc2Statement > > [javac] required: org.postgresql.jdbc2.Statement > > [javac] ((AbstractJdbc2ResultSet)result).setStatement((Statement)this); > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java:49: inconvertible types > > [javac] found : org.postgresql.jdbc2.ResultSet > > [javac] required: org.postgresql.jdbc2.AbstractJdbc2ResultSet > > [javac] this.rawString = ((AbstractJdbc2ResultSet)rs).getFixedString(idx); > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2CallableStatement.java:16: cannot resolvesymbol > > [javac] symbol : constructor Jdbc2ResultSet (org.postgresql.jdbc2.Jdbc2CallableStatement,org.postgresql.Field[],java.util.Vector,java.lang.String,int,long,boolean) > > [javac] location: class org.postgresql.jdbc2.Jdbc2ResultSet > > [javac] return new Jdbc2ResultSet(this, fields, tuples, status, updateCount, insertOID, binaryCursor); > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2PreparedStatement.java:16: cannot resolvesymbol > > [javac] symbol : constructor Jdbc2ResultSet (org.postgresql.jdbc2.Jdbc2PreparedStatement,org.postgresql.Field[],java.util.Vector,java.lang.String,int,long,boolean) > > [javac] location: class org.postgresql.jdbc2.Jdbc2ResultSet > > [javac] return new Jdbc2ResultSet(this, fields, tuples, status, updateCount, insertOID, binaryCursor); > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java:13: getStatement() inorg.postgresql.jdbc2.AbstractJdbc2ResultSet cannot implement getStatement() in java.sql.ResultSet; attempting to use incompatiblereturn type > > [javac] found : org.postgresql.jdbc2.Statement > > [javac] required: java.sql.Statement > > [javac] public class Jdbc2ResultSet extends org.postgresql.jdbc2.AbstractJdbc2ResultSet implements java.sql.ResultSet > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2Statement.java:21: cannot resolve symbol > > [javac] symbol : constructor Jdbc2ResultSet (org.postgresql.jdbc2.Jdbc2Statement,org.postgresql.Field[],java.util.Vector,java.lang.String,int,long,boolean) > > [javac] location: class org.postgresql.jdbc2.Jdbc2ResultSet > > [javac] return new Jdbc2ResultSet(this, fields, tuples, status, updateCount, insertOID, binaryCursor); > > [javac] ^ > > [javac] Note: Some input files use or override a deprecated API. > > [javac] Note: Recompile with -deprecation for details. > > [javac] 14 errors > > > > BUILD FAILED > > file:/home/adler/work/pgsql/src/interfaces/jdbc/build.xml:106: Compile failed; see the compiler error output for details. > > > > Total time: 5 seconds > > make: *** [all] Error 1 > > > > > > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ ant -version > > Apache Ant version 1.5.1 compiled on October 23 2002 > > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ > > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ java -version > > java version "1.3.1" > > Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.3.1-02b-FCS) > > Java HotSpot(TM) Client VM (build Blackdown-1.3.1_02b-FCS, mixed mode) > > > > > > ---------------------------(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 <Dave@micro-automation.net> > Mike Adler
It appears you committed only part of Oliver Jowett's patch for JDBC3 methods, so a compile fails for jdk1.4. You did not commit the changes for org.postgresql.jdbc1.AbstractJdbc1Connection Kris Jurka On 4 Feb 2003, Dave Cramer wrote: > Michael, > > Do you have an old postgres.jar in the classpath somewhere? > > DAve > On Tue, 2003-02-04 at 21:07, Michael Adler wrote: > > I cannot build the driver from current CVS sources. Any suggestions? > > > > thanks. > > > > > > > > > > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ cvs update -CAPd && make clean && make > > ? build > > ? build.properties > > ? jars > > ? typescript > > ? org/postgresql/Driver.java > > cvs server: Updating . > > cvs server: Updating example > > cvs server: Updating example/corba > > cvs server: Updating org > > cvs server: Updating org/postgresql > > cvs server: Updating org/postgresql/core > > cvs server: Updating org/postgresql/fastpath > > cvs server: Updating org/postgresql/geometric > > cvs server: Updating org/postgresql/jdbc1 > > cvs server: Updating org/postgresql/jdbc2 > > cvs server: Updating org/postgresql/jdbc2/optional > > cvs server: Updating org/postgresql/jdbc3 > > cvs server: Updating org/postgresql/largeobject > > cvs server: Updating org/postgresql/test > > cvs server: Updating org/postgresql/test/jdbc2 > > cvs server: Updating org/postgresql/test/jdbc2/optional > > cvs server: Updating org/postgresql/test/jdbc3 > > cvs server: Updating org/postgresql/test/util > > cvs server: Updating org/postgresql/util > > cvs server: Updating org/postgresql/xa > > cvs server: Updating postgresql > > cvs server: Updating postgresql/fastpath > > cvs server: Updating postgresql/geometric > > cvs server: Updating postgresql/jdbc1 > > cvs server: Updating postgresql/jdbc2 > > cvs server: Updating postgresql/largeobject > > cvs server: Updating postgresql/util > > cvs server: Updating utils > > /usr/bin/ant -buildfile ./build.xml clean_all > > Buildfile: ./build.xml > > > > clean: > > [delete] Deleting directory /home/adler/work/pgsql/src/interfaces/jdbc/build > > [delete] Deleting directory /home/adler/work/pgsql/src/interfaces/jdbc/jars > > [delete] Deleting: /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/Driver.java > > > > clean_all: > > [delete] Deleting: /home/adler/work/pgsql/src/interfaces/jdbc/build.properties > > > > BUILD SUCCESSFUL > > Total time: 2 seconds > > echo "# This file was created by 'make build.properties'." > build.properties > > echo major=7 >> build.properties > > echo minor=4 >> build.properties > > echo fullversion=7.4devel >> build.properties > > echo def_pgport=5432 >> build.properties > > echo enable_debug=no >> build.properties > > /usr/bin/ant -buildfile ./build.xml all > > Buildfile: ./build.xml > > > > all: > > > > prepare: > > [mkdir] Created dir: /home/adler/work/pgsql/src/interfaces/jdbc/build > > [mkdir] Created dir: /home/adler/work/pgsql/src/interfaces/jdbc/jars > > > > check_versions: > > > > check_driver: > > > > driver: > > [copy] Copying 1 file to /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql > > [echo] Configured build for the JDBC2 edition driver > > > > compile: > > [javac] Compiling 56 source files to /home/adler/work/pgsql/src/interfaces/jdbc/build > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java:26: reference to ResultSetis ambiguous, both class org.postgresql.ResultSet in org.postgresql and class java.sql.ResultSet in java.sql match > > [javac] public static ResultSet execute (String[] p_sqlFrags, > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:239: cannot resolvesymbol > > [javac] symbol : constructor Array (org.postgresql.PGConnection,int,org.postgresql.Field,java.sql.ResultSet) > > [javac] location: class org.postgresql.jdbc2.Array > > [javac] return (java.sql.Array) new org.postgresql.jdbc2.Array( connection, i, fields[i - 1], (java.sql.ResultSet)this ); > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:417: incompatibletypes > > [javac] found : java.sql.Statement > > [javac] required: org.postgresql.jdbc2.Statement > > [javac] return statement; > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:557: incompatibletypes > > [javac] found : java.sql.PreparedStatement > > [javac] required: org.postgresql.jdbc2.PreparedStatement > > [javac] deleteStatement = ((java.sql.Connection) connection).prepareStatement(deleteSQL.toString()); > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:616: incompatibletypes > > [javac] found : java.sql.PreparedStatement > > [javac] required: org.postgresql.jdbc2.PreparedStatement > > [javac] insertStatement = ((java.sql.Connection) connection).prepareStatement(insertSQL.toString()); > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:636: inconvertibletypes > > [javac] found : org.postgresql.jdbc2.PreparedStatement > > [javac] required: org.postgresql.jdbc2.AbstractJdbc2Statement > > [javac] long insertedOID = ((AbstractJdbc2Statement) insertStatement).getLastOID(); > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:950: incompatibletypes > > [javac] found : java.sql.PreparedStatement > > [javac] required: org.postgresql.jdbc2.PreparedStatement > > [javac] selectStatement = ((java.sql.Connection) connection).prepareStatement(selectSQL.toString()); > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1038: incompatibletypes > > [javac] found : java.sql.PreparedStatement > > [javac] required: org.postgresql.jdbc2.PreparedStatement > > [javac] updateStatement = ((java.sql.Connection) connection).prepareStatement(updateSQL.toString()); > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java:51: inconvertibletypes > > [javac] found : org.postgresql.jdbc2.AbstractJdbc2Statement > > [javac] required: org.postgresql.jdbc2.Statement > > [javac] ((AbstractJdbc2ResultSet)result).setStatement((Statement)this); > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java:49: inconvertible types > > [javac] found : org.postgresql.jdbc2.ResultSet > > [javac] required: org.postgresql.jdbc2.AbstractJdbc2ResultSet > > [javac] this.rawString = ((AbstractJdbc2ResultSet)rs).getFixedString(idx); > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2CallableStatement.java:16: cannot resolvesymbol > > [javac] symbol : constructor Jdbc2ResultSet (org.postgresql.jdbc2.Jdbc2CallableStatement,org.postgresql.Field[],java.util.Vector,java.lang.String,int,long,boolean) > > [javac] location: class org.postgresql.jdbc2.Jdbc2ResultSet > > [javac] return new Jdbc2ResultSet(this, fields, tuples, status, updateCount, insertOID, binaryCursor); > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2PreparedStatement.java:16: cannot resolvesymbol > > [javac] symbol : constructor Jdbc2ResultSet (org.postgresql.jdbc2.Jdbc2PreparedStatement,org.postgresql.Field[],java.util.Vector,java.lang.String,int,long,boolean) > > [javac] location: class org.postgresql.jdbc2.Jdbc2ResultSet > > [javac] return new Jdbc2ResultSet(this, fields, tuples, status, updateCount, insertOID, binaryCursor); > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java:13: getStatement() inorg.postgresql.jdbc2.AbstractJdbc2ResultSet cannot implement getStatement() in java.sql.ResultSet; attempting to use incompatiblereturn type > > [javac] found : org.postgresql.jdbc2.Statement > > [javac] required: java.sql.Statement > > [javac] public class Jdbc2ResultSet extends org.postgresql.jdbc2.AbstractJdbc2ResultSet implements java.sql.ResultSet > > [javac] ^ > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2Statement.java:21: cannot resolve symbol > > [javac] symbol : constructor Jdbc2ResultSet (org.postgresql.jdbc2.Jdbc2Statement,org.postgresql.Field[],java.util.Vector,java.lang.String,int,long,boolean) > > [javac] location: class org.postgresql.jdbc2.Jdbc2ResultSet > > [javac] return new Jdbc2ResultSet(this, fields, tuples, status, updateCount, insertOID, binaryCursor); > > [javac] ^ > > [javac] Note: Some input files use or override a deprecated API. > > [javac] Note: Recompile with -deprecation for details. > > [javac] 14 errors > > > > BUILD FAILED > > file:/home/adler/work/pgsql/src/interfaces/jdbc/build.xml:106: Compile failed; see the compiler error output for details. > > > > Total time: 5 seconds > > make: *** [all] Error 1 > > > > > > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ ant -version > > Apache Ant version 1.5.1 compiled on October 23 2002 > > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ > > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ java -version > > java version "1.3.1" > > Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.3.1-02b-FCS) > > Java HotSpot(TM) Client VM (build Blackdown-1.3.1_02b-FCS, mixed mode) > > > > > > ---------------------------(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 <Dave@micro-automation.net> > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org >
No, I didn't since you mentioned that his changes would break 1.1 compiles? Dave On Tue, 2003-02-04 at 21:22, Kris Jurka wrote: > It appears you committed only part of Oliver Jowett's patch for JDBC3 > methods, so a compile fails for jdk1.4. You did not commit the changes > for org.postgresql.jdbc1.AbstractJdbc1Connection > > Kris Jurka > > > On 4 Feb 2003, Dave Cramer wrote: > > > Michael, > > > > Do you have an old postgres.jar in the classpath somewhere? > > > > DAve > > On Tue, 2003-02-04 at 21:07, Michael Adler wrote: > > > I cannot build the driver from current CVS sources. Any suggestions? > > > > > > thanks. > > > > > > > > > > > > > > > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ cvs update -CAPd && make clean && make > > > ? build > > > ? build.properties > > > ? jars > > > ? typescript > > > ? org/postgresql/Driver.java > > > cvs server: Updating . > > > cvs server: Updating example > > > cvs server: Updating example/corba > > > cvs server: Updating org > > > cvs server: Updating org/postgresql > > > cvs server: Updating org/postgresql/core > > > cvs server: Updating org/postgresql/fastpath > > > cvs server: Updating org/postgresql/geometric > > > cvs server: Updating org/postgresql/jdbc1 > > > cvs server: Updating org/postgresql/jdbc2 > > > cvs server: Updating org/postgresql/jdbc2/optional > > > cvs server: Updating org/postgresql/jdbc3 > > > cvs server: Updating org/postgresql/largeobject > > > cvs server: Updating org/postgresql/test > > > cvs server: Updating org/postgresql/test/jdbc2 > > > cvs server: Updating org/postgresql/test/jdbc2/optional > > > cvs server: Updating org/postgresql/test/jdbc3 > > > cvs server: Updating org/postgresql/test/util > > > cvs server: Updating org/postgresql/util > > > cvs server: Updating org/postgresql/xa > > > cvs server: Updating postgresql > > > cvs server: Updating postgresql/fastpath > > > cvs server: Updating postgresql/geometric > > > cvs server: Updating postgresql/jdbc1 > > > cvs server: Updating postgresql/jdbc2 > > > cvs server: Updating postgresql/largeobject > > > cvs server: Updating postgresql/util > > > cvs server: Updating utils > > > /usr/bin/ant -buildfile ./build.xml clean_all > > > Buildfile: ./build.xml > > > > > > clean: > > > [delete] Deleting directory /home/adler/work/pgsql/src/interfaces/jdbc/build > > > [delete] Deleting directory /home/adler/work/pgsql/src/interfaces/jdbc/jars > > > [delete] Deleting: /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/Driver.java > > > > > > clean_all: > > > [delete] Deleting: /home/adler/work/pgsql/src/interfaces/jdbc/build.properties > > > > > > BUILD SUCCESSFUL > > > Total time: 2 seconds > > > echo "# This file was created by 'make build.properties'." > build.properties > > > echo major=7 >> build.properties > > > echo minor=4 >> build.properties > > > echo fullversion=7.4devel >> build.properties > > > echo def_pgport=5432 >> build.properties > > > echo enable_debug=no >> build.properties > > > /usr/bin/ant -buildfile ./build.xml all > > > Buildfile: ./build.xml > > > > > > all: > > > > > > prepare: > > > [mkdir] Created dir: /home/adler/work/pgsql/src/interfaces/jdbc/build > > > [mkdir] Created dir: /home/adler/work/pgsql/src/interfaces/jdbc/jars > > > > > > check_versions: > > > > > > check_driver: > > > > > > driver: > > > [copy] Copying 1 file to /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql > > > [echo] Configured build for the JDBC2 edition driver > > > > > > compile: > > > [javac] Compiling 56 source files to /home/adler/work/pgsql/src/interfaces/jdbc/build > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java:26: reference to ResultSetis ambiguous, both class org.postgresql.ResultSet in org.postgresql and class java.sql.ResultSet in java.sql match > > > [javac] public static ResultSet execute (String[] p_sqlFrags, > > > [javac] ^ > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:239: cannotresolve symbol > > > [javac] symbol : constructor Array (org.postgresql.PGConnection,int,org.postgresql.Field,java.sql.ResultSet) > > > [javac] location: class org.postgresql.jdbc2.Array > > > [javac] return (java.sql.Array) new org.postgresql.jdbc2.Array( connection, i, fields[i - 1], (java.sql.ResultSet)this ); > > > [javac] ^ > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:417: incompatibletypes > > > [javac] found : java.sql.Statement > > > [javac] required: org.postgresql.jdbc2.Statement > > > [javac] return statement; > > > [javac] ^ > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:557: incompatibletypes > > > [javac] found : java.sql.PreparedStatement > > > [javac] required: org.postgresql.jdbc2.PreparedStatement > > > [javac] deleteStatement = ((java.sql.Connection) connection).prepareStatement(deleteSQL.toString()); > > > [javac] ^ > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:616: incompatibletypes > > > [javac] found : java.sql.PreparedStatement > > > [javac] required: org.postgresql.jdbc2.PreparedStatement > > > [javac] insertStatement = ((java.sql.Connection) connection).prepareStatement(insertSQL.toString()); > > > [javac] ^ > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:636: inconvertibletypes > > > [javac] found : org.postgresql.jdbc2.PreparedStatement > > > [javac] required: org.postgresql.jdbc2.AbstractJdbc2Statement > > > [javac] long insertedOID = ((AbstractJdbc2Statement) insertStatement).getLastOID(); > > > [javac] ^ > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:950: incompatibletypes > > > [javac] found : java.sql.PreparedStatement > > > [javac] required: org.postgresql.jdbc2.PreparedStatement > > > [javac] selectStatement = ((java.sql.Connection) connection).prepareStatement(selectSQL.toString()); > > > [javac] ^ > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1038: incompatibletypes > > > [javac] found : java.sql.PreparedStatement > > > [javac] required: org.postgresql.jdbc2.PreparedStatement > > > [javac] updateStatement = ((java.sql.Connection) connection).prepareStatement(updateSQL.toString()); > > > [javac] ^ > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java:51: inconvertibletypes > > > [javac] found : org.postgresql.jdbc2.AbstractJdbc2Statement > > > [javac] required: org.postgresql.jdbc2.Statement > > > [javac] ((AbstractJdbc2ResultSet)result).setStatement((Statement)this); > > > [javac] ^ > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java:49: inconvertible types > > > [javac] found : org.postgresql.jdbc2.ResultSet > > > [javac] required: org.postgresql.jdbc2.AbstractJdbc2ResultSet > > > [javac] this.rawString = ((AbstractJdbc2ResultSet)rs).getFixedString(idx); > > > [javac] ^ > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2CallableStatement.java:16: cannotresolve symbol > > > [javac] symbol : constructor Jdbc2ResultSet (org.postgresql.jdbc2.Jdbc2CallableStatement,org.postgresql.Field[],java.util.Vector,java.lang.String,int,long,boolean) > > > [javac] location: class org.postgresql.jdbc2.Jdbc2ResultSet > > > [javac] return new Jdbc2ResultSet(this, fields, tuples, status, updateCount, insertOID, binaryCursor); > > > [javac] ^ > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2PreparedStatement.java:16: cannotresolve symbol > > > [javac] symbol : constructor Jdbc2ResultSet (org.postgresql.jdbc2.Jdbc2PreparedStatement,org.postgresql.Field[],java.util.Vector,java.lang.String,int,long,boolean) > > > [javac] location: class org.postgresql.jdbc2.Jdbc2ResultSet > > > [javac] return new Jdbc2ResultSet(this, fields, tuples, status, updateCount, insertOID, binaryCursor); > > > [javac] ^ > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java:13: getStatement()in org.postgresql.jdbc2.AbstractJdbc2ResultSet cannot implement getStatement() in java.sql.ResultSet; attemptingto use incompatible return type > > > [javac] found : org.postgresql.jdbc2.Statement > > > [javac] required: java.sql.Statement > > > [javac] public class Jdbc2ResultSet extends org.postgresql.jdbc2.AbstractJdbc2ResultSet implements java.sql.ResultSet > > > [javac] ^ > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2Statement.java:21: cannot resolvesymbol > > > [javac] symbol : constructor Jdbc2ResultSet (org.postgresql.jdbc2.Jdbc2Statement,org.postgresql.Field[],java.util.Vector,java.lang.String,int,long,boolean) > > > [javac] location: class org.postgresql.jdbc2.Jdbc2ResultSet > > > [javac] return new Jdbc2ResultSet(this, fields, tuples, status, updateCount, insertOID, binaryCursor); > > > [javac] ^ > > > [javac] Note: Some input files use or override a deprecated API. > > > [javac] Note: Recompile with -deprecation for details. > > > [javac] 14 errors > > > > > > BUILD FAILED > > > file:/home/adler/work/pgsql/src/interfaces/jdbc/build.xml:106: Compile failed; see the compiler error output for details. > > > > > > Total time: 5 seconds > > > make: *** [all] Error 1 > > > > > > > > > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ ant -version > > > Apache Ant version 1.5.1 compiled on October 23 2002 > > > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ > > > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ java -version > > > java version "1.3.1" > > > Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.3.1-02b-FCS) > > > Java HotSpot(TM) Client VM (build Blackdown-1.3.1_02b-FCS, mixed mode) > > > > > > > > > ---------------------------(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 <Dave@micro-automation.net> > > > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > > > -- Dave Cramer <Dave@micro-automation.net>
On 4 Feb 2003, Dave Cramer wrote: > No, I didn't since you mentioned that his changes would break 1.1 > compiles? My comments with regard to jdk1.1 were for sorting the results of getTypeInfo in org.postgresql.jdbc1.AbstractJdbc1DatabaseMetaData. The changes to org.postgresql.jdbc3.AbstractJdbc3DatabaseMetaData include public int getDatabaseMajorVersion() throws SQLException { return connection.getServerMajorVersion(); } public int getDatabaseMinorVersion() throws SQLException { return connection.getServerMinorVersion(); } This requires the addition of the getServerMajorVersion and getServerMinorVersion methods to the Connection class. Perhaps they should be added to the AbstractJdbc3Connection class rather than AbstractJdbc1Connection class, but as things stand the driver will not build for jdk1.4 Kris Jurka > Dave > On Tue, 2003-02-04 at 21:22, Kris Jurka wrote: > > It appears you committed only part of Oliver Jowett's patch for JDBC3 > > methods, so a compile fails for jdk1.4. You did not commit the changes > > for org.postgresql.jdbc1.AbstractJdbc1Connection > > > > Kris Jurka > > > > > > On 4 Feb 2003, Dave Cramer wrote: > > > > > Michael, > > > > > > Do you have an old postgres.jar in the classpath somewhere? > > > > > > DAve > > > On Tue, 2003-02-04 at 21:07, Michael Adler wrote: > > > > I cannot build the driver from current CVS sources. Any suggestions? > > > > > > > > thanks. > > > > > > > > > > > > > > > > > > > > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ cvs update -CAPd && make clean && make > > > > ? build > > > > ? build.properties > > > > ? jars > > > > ? typescript > > > > ? org/postgresql/Driver.java > > > > cvs server: Updating . > > > > cvs server: Updating example > > > > cvs server: Updating example/corba > > > > cvs server: Updating org > > > > cvs server: Updating org/postgresql > > > > cvs server: Updating org/postgresql/core > > > > cvs server: Updating org/postgresql/fastpath > > > > cvs server: Updating org/postgresql/geometric > > > > cvs server: Updating org/postgresql/jdbc1 > > > > cvs server: Updating org/postgresql/jdbc2 > > > > cvs server: Updating org/postgresql/jdbc2/optional > > > > cvs server: Updating org/postgresql/jdbc3 > > > > cvs server: Updating org/postgresql/largeobject > > > > cvs server: Updating org/postgresql/test > > > > cvs server: Updating org/postgresql/test/jdbc2 > > > > cvs server: Updating org/postgresql/test/jdbc2/optional > > > > cvs server: Updating org/postgresql/test/jdbc3 > > > > cvs server: Updating org/postgresql/test/util > > > > cvs server: Updating org/postgresql/util > > > > cvs server: Updating org/postgresql/xa > > > > cvs server: Updating postgresql > > > > cvs server: Updating postgresql/fastpath > > > > cvs server: Updating postgresql/geometric > > > > cvs server: Updating postgresql/jdbc1 > > > > cvs server: Updating postgresql/jdbc2 > > > > cvs server: Updating postgresql/largeobject > > > > cvs server: Updating postgresql/util > > > > cvs server: Updating utils > > > > /usr/bin/ant -buildfile ./build.xml clean_all > > > > Buildfile: ./build.xml > > > > > > > > clean: > > > > [delete] Deleting directory /home/adler/work/pgsql/src/interfaces/jdbc/build > > > > [delete] Deleting directory /home/adler/work/pgsql/src/interfaces/jdbc/jars > > > > [delete] Deleting: /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/Driver.java > > > > > > > > clean_all: > > > > [delete] Deleting: /home/adler/work/pgsql/src/interfaces/jdbc/build.properties > > > > > > > > BUILD SUCCESSFUL > > > > Total time: 2 seconds > > > > echo "# This file was created by 'make build.properties'." > build.properties > > > > echo major=7 >> build.properties > > > > echo minor=4 >> build.properties > > > > echo fullversion=7.4devel >> build.properties > > > > echo def_pgport=5432 >> build.properties > > > > echo enable_debug=no >> build.properties > > > > /usr/bin/ant -buildfile ./build.xml all > > > > Buildfile: ./build.xml > > > > > > > > all: > > > > > > > > prepare: > > > > [mkdir] Created dir: /home/adler/work/pgsql/src/interfaces/jdbc/build > > > > [mkdir] Created dir: /home/adler/work/pgsql/src/interfaces/jdbc/jars > > > > > > > > check_versions: > > > > > > > > check_driver: > > > > > > > > driver: > > > > [copy] Copying 1 file to /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql > > > > [echo] Configured build for the JDBC2 edition driver > > > > > > > > compile: > > > > [javac] Compiling 56 source files to /home/adler/work/pgsql/src/interfaces/jdbc/build > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java:26: reference to ResultSetis ambiguous, both class org.postgresql.ResultSet in org.postgresql and class java.sql.ResultSet in java.sql match > > > > [javac] public static ResultSet execute (String[] p_sqlFrags, > > > > [javac] ^ > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:239: cannotresolve symbol > > > > [javac] symbol : constructor Array (org.postgresql.PGConnection,int,org.postgresql.Field,java.sql.ResultSet) > > > > [javac] location: class org.postgresql.jdbc2.Array > > > > [javac] return (java.sql.Array) new org.postgresql.jdbc2.Array( connection, i, fields[i - 1], (java.sql.ResultSet)this ); > > > > [javac] ^ > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:417: incompatibletypes > > > > [javac] found : java.sql.Statement > > > > [javac] required: org.postgresql.jdbc2.Statement > > > > [javac] return statement; > > > > [javac] ^ > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:557: incompatibletypes > > > > [javac] found : java.sql.PreparedStatement > > > > [javac] required: org.postgresql.jdbc2.PreparedStatement > > > > [javac] deleteStatement = ((java.sql.Connection) connection).prepareStatement(deleteSQL.toString()); > > > > [javac] ^ > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:616: incompatibletypes > > > > [javac] found : java.sql.PreparedStatement > > > > [javac] required: org.postgresql.jdbc2.PreparedStatement > > > > [javac] insertStatement = ((java.sql.Connection) connection).prepareStatement(insertSQL.toString()); > > > > [javac] ^ > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:636: inconvertibletypes > > > > [javac] found : org.postgresql.jdbc2.PreparedStatement > > > > [javac] required: org.postgresql.jdbc2.AbstractJdbc2Statement > > > > [javac] long insertedOID = ((AbstractJdbc2Statement) insertStatement).getLastOID(); > > > > [javac] ^ > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:950: incompatibletypes > > > > [javac] found : java.sql.PreparedStatement > > > > [javac] required: org.postgresql.jdbc2.PreparedStatement > > > > [javac] selectStatement = ((java.sql.Connection) connection).prepareStatement(selectSQL.toString()); > > > > [javac] ^ > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1038: incompatibletypes > > > > [javac] found : java.sql.PreparedStatement > > > > [javac] required: org.postgresql.jdbc2.PreparedStatement > > > > [javac] updateStatement = ((java.sql.Connection) connection).prepareStatement(updateSQL.toString()); > > > > [javac] ^ > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java:51: inconvertibletypes > > > > [javac] found : org.postgresql.jdbc2.AbstractJdbc2Statement > > > > [javac] required: org.postgresql.jdbc2.Statement > > > > [javac] ((AbstractJdbc2ResultSet)result).setStatement((Statement)this); > > > > [javac] ^ > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java:49: inconvertible types > > > > [javac] found : org.postgresql.jdbc2.ResultSet > > > > [javac] required: org.postgresql.jdbc2.AbstractJdbc2ResultSet > > > > [javac] this.rawString = ((AbstractJdbc2ResultSet)rs).getFixedString(idx); > > > > [javac] ^ > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2CallableStatement.java:16: cannotresolve symbol > > > > [javac] symbol : constructor Jdbc2ResultSet (org.postgresql.jdbc2.Jdbc2CallableStatement,org.postgresql.Field[],java.util.Vector,java.lang.String,int,long,boolean) > > > > [javac] location: class org.postgresql.jdbc2.Jdbc2ResultSet > > > > [javac] return new Jdbc2ResultSet(this, fields, tuples, status, updateCount, insertOID, binaryCursor); > > > > [javac] ^ > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2PreparedStatement.java:16: cannotresolve symbol > > > > [javac] symbol : constructor Jdbc2ResultSet (org.postgresql.jdbc2.Jdbc2PreparedStatement,org.postgresql.Field[],java.util.Vector,java.lang.String,int,long,boolean) > > > > [javac] location: class org.postgresql.jdbc2.Jdbc2ResultSet > > > > [javac] return new Jdbc2ResultSet(this, fields, tuples, status, updateCount, insertOID, binaryCursor); > > > > [javac] ^ > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java:13: getStatement()in org.postgresql.jdbc2.AbstractJdbc2ResultSet cannot implement getStatement() in java.sql.ResultSet; attemptingto use incompatible return type > > > > [javac] found : org.postgresql.jdbc2.Statement > > > > [javac] required: java.sql.Statement > > > > [javac] public class Jdbc2ResultSet extends org.postgresql.jdbc2.AbstractJdbc2ResultSet implements java.sql.ResultSet > > > > [javac] ^ > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2Statement.java:21: cannot resolvesymbol > > > > [javac] symbol : constructor Jdbc2ResultSet (org.postgresql.jdbc2.Jdbc2Statement,org.postgresql.Field[],java.util.Vector,java.lang.String,int,long,boolean) > > > > [javac] location: class org.postgresql.jdbc2.Jdbc2ResultSet > > > > [javac] return new Jdbc2ResultSet(this, fields, tuples, status, updateCount, insertOID, binaryCursor); > > > > [javac] ^ > > > > [javac] Note: Some input files use or override a deprecated API. > > > > [javac] Note: Recompile with -deprecation for details. > > > > [javac] 14 errors > > > > > > > > BUILD FAILED > > > > file:/home/adler/work/pgsql/src/interfaces/jdbc/build.xml:106: Compile failed; see the compiler error output fordetails. > > > > > > > > Total time: 5 seconds > > > > make: *** [all] Error 1 > > > > > > > > > > > > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ ant -version > > > > Apache Ant version 1.5.1 compiled on October 23 2002 > > > > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ > > > > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ java -version > > > > java version "1.3.1" > > > > Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.3.1-02b-FCS) > > > > Java HotSpot(TM) Client VM (build Blackdown-1.3.1_02b-FCS, mixed mode) > > > > > > > > > > > > ---------------------------(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 <Dave@micro-automation.net> > > > > > > > > > ---------------------------(end of broadcast)--------------------------- > > > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > > > > > > -- > Dave Cramer <Dave@micro-automation.net> > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly >
Kris, Sorry about that, for some reason I forgot to commit the changes to AbstractJdbc1Connection. s/b fixed now Thanks, Dave On Wed, 2003-02-05 at 01:22, Kris Jurka wrote: > > On 4 Feb 2003, Dave Cramer wrote: > > > No, I didn't since you mentioned that his changes would break 1.1 > > compiles? > > My comments with regard to jdk1.1 were for sorting the results of > getTypeInfo in org.postgresql.jdbc1.AbstractJdbc1DatabaseMetaData. > > The changes to org.postgresql.jdbc3.AbstractJdbc3DatabaseMetaData include > > public int getDatabaseMajorVersion() throws SQLException > { > return connection.getServerMajorVersion(); > } > > public int getDatabaseMinorVersion() throws SQLException > { > return connection.getServerMinorVersion(); > } > > This requires the addition of the getServerMajorVersion and > getServerMinorVersion methods to the Connection class. Perhaps they > should be added to the AbstractJdbc3Connection class rather than > AbstractJdbc1Connection class, but as things stand the driver will not > build for jdk1.4 > > Kris Jurka > > > > Dave > > On Tue, 2003-02-04 at 21:22, Kris Jurka wrote: > > > It appears you committed only part of Oliver Jowett's patch for JDBC3 > > > methods, so a compile fails for jdk1.4. You did not commit the changes > > > for org.postgresql.jdbc1.AbstractJdbc1Connection > > > > > > Kris Jurka > > > > > > > > > On 4 Feb 2003, Dave Cramer wrote: > > > > > > > Michael, > > > > > > > > Do you have an old postgres.jar in the classpath somewhere? > > > > > > > > DAve > > > > On Tue, 2003-02-04 at 21:07, Michael Adler wrote: > > > > > I cannot build the driver from current CVS sources. Any suggestions? > > > > > > > > > > thanks. > > > > > > > > > > > > > > > > > > > > > > > > > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ cvs update -CAPd && make clean && make > > > > > ? build > > > > > ? build.properties > > > > > ? jars > > > > > ? typescript > > > > > ? org/postgresql/Driver.java > > > > > cvs server: Updating . > > > > > cvs server: Updating example > > > > > cvs server: Updating example/corba > > > > > cvs server: Updating org > > > > > cvs server: Updating org/postgresql > > > > > cvs server: Updating org/postgresql/core > > > > > cvs server: Updating org/postgresql/fastpath > > > > > cvs server: Updating org/postgresql/geometric > > > > > cvs server: Updating org/postgresql/jdbc1 > > > > > cvs server: Updating org/postgresql/jdbc2 > > > > > cvs server: Updating org/postgresql/jdbc2/optional > > > > > cvs server: Updating org/postgresql/jdbc3 > > > > > cvs server: Updating org/postgresql/largeobject > > > > > cvs server: Updating org/postgresql/test > > > > > cvs server: Updating org/postgresql/test/jdbc2 > > > > > cvs server: Updating org/postgresql/test/jdbc2/optional > > > > > cvs server: Updating org/postgresql/test/jdbc3 > > > > > cvs server: Updating org/postgresql/test/util > > > > > cvs server: Updating org/postgresql/util > > > > > cvs server: Updating org/postgresql/xa > > > > > cvs server: Updating postgresql > > > > > cvs server: Updating postgresql/fastpath > > > > > cvs server: Updating postgresql/geometric > > > > > cvs server: Updating postgresql/jdbc1 > > > > > cvs server: Updating postgresql/jdbc2 > > > > > cvs server: Updating postgresql/largeobject > > > > > cvs server: Updating postgresql/util > > > > > cvs server: Updating utils > > > > > /usr/bin/ant -buildfile ./build.xml clean_all > > > > > Buildfile: ./build.xml > > > > > > > > > > clean: > > > > > [delete] Deleting directory /home/adler/work/pgsql/src/interfaces/jdbc/build > > > > > [delete] Deleting directory /home/adler/work/pgsql/src/interfaces/jdbc/jars > > > > > [delete] Deleting: /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/Driver.java > > > > > > > > > > clean_all: > > > > > [delete] Deleting: /home/adler/work/pgsql/src/interfaces/jdbc/build.properties > > > > > > > > > > BUILD SUCCESSFUL > > > > > Total time: 2 seconds > > > > > echo "# This file was created by 'make build.properties'." > build.properties > > > > > echo major=7 >> build.properties > > > > > echo minor=4 >> build.properties > > > > > echo fullversion=7.4devel >> build.properties > > > > > echo def_pgport=5432 >> build.properties > > > > > echo enable_debug=no >> build.properties > > > > > /usr/bin/ant -buildfile ./build.xml all > > > > > Buildfile: ./build.xml > > > > > > > > > > all: > > > > > > > > > > prepare: > > > > > [mkdir] Created dir: /home/adler/work/pgsql/src/interfaces/jdbc/build > > > > > [mkdir] Created dir: /home/adler/work/pgsql/src/interfaces/jdbc/jars > > > > > > > > > > check_versions: > > > > > > > > > > check_driver: > > > > > > > > > > driver: > > > > > [copy] Copying 1 file to /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql > > > > > [echo] Configured build for the JDBC2 edition driver > > > > > > > > > > compile: > > > > > [javac] Compiling 56 source files to /home/adler/work/pgsql/src/interfaces/jdbc/build > > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java:26: reference toResultSet is ambiguous, both class org.postgresql.ResultSet in org.postgresql and class java.sql.ResultSet in java.sqlmatch > > > > > [javac] public static ResultSet execute (String[] p_sqlFrags, > > > > > [javac] ^ > > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:239: cannotresolve symbol > > > > > [javac] symbol : constructor Array (org.postgresql.PGConnection,int,org.postgresql.Field,java.sql.ResultSet) > > > > > [javac] location: class org.postgresql.jdbc2.Array > > > > > [javac] return (java.sql.Array) new org.postgresql.jdbc2.Array( connection, i, fields[i - 1], (java.sql.ResultSet)this ); > > > > > [javac] ^ > > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:417: incompatibletypes > > > > > [javac] found : java.sql.Statement > > > > > [javac] required: org.postgresql.jdbc2.Statement > > > > > [javac] return statement; > > > > > [javac] ^ > > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:557: incompatibletypes > > > > > [javac] found : java.sql.PreparedStatement > > > > > [javac] required: org.postgresql.jdbc2.PreparedStatement > > > > > [javac] deleteStatement = ((java.sql.Connection) connection).prepareStatement(deleteSQL.toString()); > > > > > [javac] ^ > > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:616: incompatibletypes > > > > > [javac] found : java.sql.PreparedStatement > > > > > [javac] required: org.postgresql.jdbc2.PreparedStatement > > > > > [javac] insertStatement = ((java.sql.Connection) connection).prepareStatement(insertSQL.toString()); > > > > > [javac] ^ > > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:636: inconvertibletypes > > > > > [javac] found : org.postgresql.jdbc2.PreparedStatement > > > > > [javac] required: org.postgresql.jdbc2.AbstractJdbc2Statement > > > > > [javac] long insertedOID = ((AbstractJdbc2Statement) insertStatement).getLastOID(); > > > > > [javac] ^ > > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:950: incompatibletypes > > > > > [javac] found : java.sql.PreparedStatement > > > > > [javac] required: org.postgresql.jdbc2.PreparedStatement > > > > > [javac] selectStatement = ((java.sql.Connection) connection).prepareStatement(selectSQL.toString()); > > > > > [javac] ^ > > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java:1038: incompatibletypes > > > > > [javac] found : java.sql.PreparedStatement > > > > > [javac] required: org.postgresql.jdbc2.PreparedStatement > > > > > [javac] updateStatement = ((java.sql.Connection) connection).prepareStatement(updateSQL.toString()); > > > > > [javac] ^ > > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java:51: inconvertibletypes > > > > > [javac] found : org.postgresql.jdbc2.AbstractJdbc2Statement > > > > > [javac] required: org.postgresql.jdbc2.Statement > > > > > [javac] ((AbstractJdbc2ResultSet)result).setStatement((Statement)this); > > > > > [javac] ^ > > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java:49: inconvertible types > > > > > [javac] found : org.postgresql.jdbc2.ResultSet > > > > > [javac] required: org.postgresql.jdbc2.AbstractJdbc2ResultSet > > > > > [javac] this.rawString = ((AbstractJdbc2ResultSet)rs).getFixedString(idx); > > > > > [javac] ^ > > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2CallableStatement.java:16: cannotresolve symbol > > > > > [javac] symbol : constructor Jdbc2ResultSet (org.postgresql.jdbc2.Jdbc2CallableStatement,org.postgresql.Field[],java.util.Vector,java.lang.String,int,long,boolean) > > > > > [javac] location: class org.postgresql.jdbc2.Jdbc2ResultSet > > > > > [javac] return new Jdbc2ResultSet(this, fields, tuples, status, updateCount, insertOID, binaryCursor); > > > > > [javac] ^ > > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2PreparedStatement.java:16: cannotresolve symbol > > > > > [javac] symbol : constructor Jdbc2ResultSet (org.postgresql.jdbc2.Jdbc2PreparedStatement,org.postgresql.Field[],java.util.Vector,java.lang.String,int,long,boolean) > > > > > [javac] location: class org.postgresql.jdbc2.Jdbc2ResultSet > > > > > [javac] return new Jdbc2ResultSet(this, fields, tuples, status, updateCount, insertOID, binaryCursor); > > > > > [javac] ^ > > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java:13: getStatement()in org.postgresql.jdbc2.AbstractJdbc2ResultSet cannot implement getStatement() in java.sql.ResultSet; attemptingto use incompatible return type > > > > > [javac] found : org.postgresql.jdbc2.Statement > > > > > [javac] required: java.sql.Statement > > > > > [javac] public class Jdbc2ResultSet extends org.postgresql.jdbc2.AbstractJdbc2ResultSet implements java.sql.ResultSet > > > > > [javac] ^ > > > > > [javac] /home/adler/work/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2Statement.java:21: cannot resolvesymbol > > > > > [javac] symbol : constructor Jdbc2ResultSet (org.postgresql.jdbc2.Jdbc2Statement,org.postgresql.Field[],java.util.Vector,java.lang.String,int,long,boolean) > > > > > [javac] location: class org.postgresql.jdbc2.Jdbc2ResultSet > > > > > [javac] return new Jdbc2ResultSet(this, fields, tuples, status, updateCount, insertOID, binaryCursor); > > > > > [javac] ^ > > > > > [javac] Note: Some input files use or override a deprecated API. > > > > > [javac] Note: Recompile with -deprecation for details. > > > > > [javac] 14 errors > > > > > > > > > > BUILD FAILED > > > > > file:/home/adler/work/pgsql/src/interfaces/jdbc/build.xml:106: Compile failed; see the compiler error output fordetails. > > > > > > > > > > Total time: 5 seconds > > > > > make: *** [all] Error 1 > > > > > > > > > > > > > > > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ ant -version > > > > > Apache Ant version 1.5.1 compiled on October 23 2002 > > > > > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ > > > > > adler@vision2:~/work/pgsql/src/interfaces/jdbc$ java -version > > > > > java version "1.3.1" > > > > > Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.3.1-02b-FCS) > > > > > Java HotSpot(TM) Client VM (build Blackdown-1.3.1_02b-FCS, mixed mode) > > > > > > > > > > > > > > > ---------------------------(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 <Dave@micro-automation.net> > > > > > > > > > > > > ---------------------------(end of broadcast)--------------------------- > > > > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > > > > > > > > > -- > > Dave Cramer <Dave@micro-automation.net> > > > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 3: if posting/reading through Usenet, please send an appropriate > > subscribe-nomail command to majordomo@postgresql.org so that your > > message can get through to the mailing list cleanly > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org -- Dave Cramer <Dave@micro-automation.net>
Joel, Thanks for the code, I do have one request though, can you use the -c switch on diff to produce a context diff, and resubmit please? Dave On Tue, 2003-02-04 at 18:17, Joel Hock wrote: > First, a big thanks to Dave Cramer for working with me on the last > insertRow() issue I had--the patch works wonderfully! > > > > Now, on to the next few things. > > > > 1. When you insert a row into a resultset that has no rows and then > call moveToCurrentRow(), you get a null pointer exception. Example > code: > > > > Statement stmt = > con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, > ResultSet.CONCUR_UPDATABLE); > > ResultSet uprs = stmt.executeQuery("SELECT oid,* FROM school WHERE > 1=0"); > > uprs.moveToInsertRow(); > > uprs.updateString("name", name); > > uprs.insertRow(); > > uprs.moveToCurrentRow(); > > > > java.lang.ArrayIndexOutOfBoundsException: -1 < 0 > > at java.util.Vector.elementAt(Vector.java:437) > > at > org.postgresql.jdbc2.AbstractJdbc2ResultSet.moveToCurrentRow(AbstractJdbc2ResultSet.java:667) > > > > The cause of this is pretty straightforward. The offending line 667 > in AbstractJdbc2ResultSet.java is: > > > > this_row = (byte[][]) rows.elementAt(current_row); > > > > current_row is -1 because the current position is before any rows. > > > > 2. After moving onto the insert row, only a few of the resultset > cursor-moving functions clear the internal “onInsertRow” variable. > According to > http://java.sun.com/docs/books/tutorial/jdbc/jdbc2dot0/inserting.html > : > > “After you have called the method insertRow , you can start building > another row to be inserted, or you can move the cursor back to a > result set row. You can, for instance, invoke any of the methods that > put the cursor on a specific row, such as first , last , beforeFirst , > afterLast , and absolute . You can also use the methods previous , > relative , and moveToCurrentRow.” > > > > However, in the current driver, only first() and moveToCurrentRow() > clear the onInsertRow flag. This causes problems when you later try > to update a row in the same resultset. The functions that need to be > modified that come to mind are: last(), beforeFirst(), afterLast(), > absolute(), previous(), next(), and relative() (relative() uses > absolute() internally, so I’ve skipped putting any code in it). > > > > I’ve included a patch to address these issues, but I’m still new to > the codebase (and my directory isn’t set up to compile), so it’ll need > a good looking-over. > > > > Thanks again, > > Joel > > > > ______________________________________________________________________ > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly -- Dave Cramer <Dave@micro-automation.net>
Sure thing-new diff is attached. Thanks again, Joel -----Original Message----- From: pgsql-jdbc-owner@postgresql.org [mailto:pgsql-jdbc-owner@postgresql.org]On Behalf Of Dave Cramer Sent: Wednesday, February 05, 2003 5:20 AM To: Joel Hock Cc: pgsql-jdbc@postgresql.org Subject: Re: [JDBC] more insertRow() bugs and fixes Joel, Thanks for the code, I do have one request though, can you use the -c switch on diff to produce a context diff, and resubmit please? Dave On Tue, 2003-02-04 at 18:17, Joel Hock wrote: > First, a big thanks to Dave Cramer for working with me on the last > insertRow() issue I had--the patch works wonderfully! > > > > Now, on to the next few things. > > > > 1. When you insert a row into a resultset that has no rows and then > call moveToCurrentRow(), you get a null pointer exception. Example > code: > > > > Statement stmt = > con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, > ResultSet.CONCUR_UPDATABLE); > > ResultSet uprs = stmt.executeQuery("SELECT oid,* FROM school WHERE > 1=0"); > > uprs.moveToInsertRow(); > > uprs.updateString("name", name); > > uprs.insertRow(); > > uprs.moveToCurrentRow(); > > > > java.lang.ArrayIndexOutOfBoundsException: -1 < 0 > > at java.util.Vector.elementAt(Vector.java:437) > > at > org.postgresql.jdbc2.AbstractJdbc2ResultSet.moveToCurrentRow(AbstractJdbc2Re sultSet.java:667) > > > > The cause of this is pretty straightforward. The offending line 667 > in AbstractJdbc2ResultSet.java is: > > > > this_row = (byte[][]) rows.elementAt(current_row); > > > > current_row is -1 because the current position is before any rows. > > > > 2. After moving onto the insert row, only a few of the resultset > cursor-moving functions clear the internal ´onInsertRow¡ variable. > According to > http://java.sun.com/docs/books/tutorial/jdbc/jdbc2dot0/inserting.html > : > > ´After you have called the method insertRow , you can start building > another row to be inserted, or you can move the cursor back to a > result set row. You can, for instance, invoke any of the methods that > put the cursor on a specific row, such as first , last , beforeFirst , > afterLast , and absolute . You can also use the methods previous , > relative , and moveToCurrentRow.¡ > > > > However, in the current driver, only first() and moveToCurrentRow() > clear the onInsertRow flag. This causes problems when you later try > to update a row in the same resultset. The functions that need to be > modified that come to mind are: last(), beforeFirst(), afterLast(), > absolute(), previous(), next(), and relative() (relative() uses > absolute() internally, so Iÿve skipped putting any code in it). > > > > Iÿve included a patch to address these issues, but Iÿm still new to > the codebase (and my directory isnÿt set up to compile), so itÿll need > a good looking-over. > > > > Thanks again, > > Joel > > > > ______________________________________________________________________ > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly -- Dave Cramer <Dave@micro-automation.net> ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly