Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 99165 invoked from network); 9 Sep 2006 07:15:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Sep 2006 07:15:59 -0000 Received: (qmail 99168 invoked by uid 500); 9 Sep 2006 07:15:59 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 98960 invoked by uid 500); 9 Sep 2006 07:15:59 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 98951 invoked by uid 99); 9 Sep 2006 07:15:59 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Sep 2006 00:15:58 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Sep 2006 00:15:58 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id BE60F7142F0 for ; Sat, 9 Sep 2006 07:12:22 +0000 (GMT) Message-ID: <7126232.1157785942750.JavaMail.jira@brutus> Date: Sat, 9 Sep 2006 00:12:22 -0700 (PDT) From: "Stephan Fuhrmann (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-1812) getGeneratedKeys() returns something weird In-Reply-To: <14638017.1157312122293.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-1812?page=comments#action_12433573 ] Stephan Fuhrmann commented on DERBY-1812: ----------------------------------------- rs.next() works ... looks like it's working. Thanks & sorry for the entry! > getGeneratedKeys() returns something weird > ------------------------------------------ > > Key: DERBY-1812 > URL: http://issues.apache.org/jira/browse/DERBY-1812 > Project: Derby > Issue Type: Bug > Components: JDBC > Affects Versions: 10.1.3.1 > Environment: java version "1.4.2-03" > Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.4.2-03) > Java HotSpot(TM) Client VM (build Blackdown-1.4.2-03, mixed mode) > Reporter: Stephan Fuhrmann > > After executing in embedded the cmd > int count=stat.executeUpdate("INSERT INTO ...",Statement.RETURN_GENERATED_KEYS); > the stat.getGeneratedKeys() returns a non-null ResultSet. The result set meta data says the result set has one column named "1". > Calling first() on this result set throws an exception telling something about a cursor that can't be set ... I guess it's better to return FALSE in case of calling first, because the API doc of getGeneratedKeys says: > "Retrieves any auto-generated keys created as a result of executing this Statement object. If this Statement object did not generate any keys, an empty ResultSet object is returned." > An empty result set would return rs.first() == false. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira