Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 04BD59FB2ED for ; Tue, 30 Jan 2007 00:38:06 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 07460-01 for ; Tue, 30 Jan 2007 00:38:02 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from www01.kensystem.com (www01.kensystem.com [72.19.170.120]) by postgresql.org (Postfix) with ESMTP id A02C29FB2FB for ; Tue, 30 Jan 2007 00:38:01 -0400 (AST) Received: from 192.168.0.3 by www01.kensystem.com (SMTPD); id s20070130043753.24518; Tue, 30 Jan 2007 04:37:53 Message-ID: <45BECBA1.8080508@kensystem.com> Date: Mon, 29 Jan 2007 21:37:53 -0700 From: Ken Johanson User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org CC: Kris Jurka Subject: Re: Synthesize support for Statement.getGeneratedKeys()? References: <4580E681.3080106@kensystem.com> <45B9A9D6.2080100@kensystem.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/182 X-Sequence-Number: 16547 Hi Kris, were you able to look at this? If time wont permit that I'll dig back in; though I'd prefer not to duplicate any work your're doing, of course. Thank, ken Kris Jurka wrote: > > > On Fri, 26 Jan 2007, Ken Johanson wrote: > >> http://onnet.cc/AbstractJdbc3Statement.patch >> http://onnet.cc/AbstractJdbc2Statement.patch > > I can't get the first patch to apply cleanly at all, erroring with > > patching file AbstractJdbc3Statement.java > patch: **** Premature `---' at line 33; check line numbers at line 21 > > And even to get to that point I had to change from windows \ to unix / > directory separators. Could we get a patch that is easy to apply? > > >> For some reason I'm getting an empty result set with this.. the >> javadocs are a tad sparse so I may not be able to resolve this for a >> day or two.. anyone better at with this api? I'm also not sure if this >> quick and dirty change will correctly handle PreparedStmts. >> > > I wouldn't be surprised if the driver is confused by an INSERT command > completion tag also having a result set. If you can produce a working > patch I'll take a closer look. > > Kris Jurka Kris, Strange about the patch. Aside from the import stmts, only the method below is changed in that source file: public int executeUpdate(String sql, String columnNames[]) throws SQLException { //fix-me "The driver will ignore the array if the SQL statement is not an INSERT statement" //fix me : impl NO_GENERATED_KEYS & RETURN_GENERATED_KEYS if (columnNames==null || columnNames.length==0) return executeUpdate(sql); //should never reallocate StringBuffer s = new StringBuffer(12+sql.length()+(columnNames.length*32)); s.append(sql); s.append('\n'); s.append("RETURNING"); s.append(' '); for (int i=0; i