Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 43523 invoked from network); 6 Apr 2006 01:29:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Apr 2006 01:29:10 -0000 Received: (qmail 68255 invoked by uid 500); 6 Apr 2006 01:29:10 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 68228 invoked by uid 500); 6 Apr 2006 01:29:09 -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 68219 invoked by uid 99); 6 Apr 2006 01:29:09 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Apr 2006 18:29:09 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Apr 2006 18:29:08 -0700 Received: from ajax (localhost.localdomain [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 471446ACAE for ; Thu, 6 Apr 2006 02:28:47 +0100 (BST) Message-ID: <1321909148.1144286927288.JavaMail.jira@ajax> Date: Thu, 6 Apr 2006 02:28:47 +0100 (BST) From: "Kathey Marsden (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-1183) Client java.sql.ResultSet.getCursorName() does not return the correct cursor name for Statements after the first execution In-Reply-To: <546769002.1144257705757.JavaMail.jira@ajax> 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-1183?page=comments#action_12373449 ] Kathey Marsden commented on DERBY-1183: --------------------------------------- Actually the workaround mentioned here to set the cursor name for each subsequent execution doesn't work. The default cursor name still prints. Apparently only the first execution can have a cursor name set. > Client java.sql.ResultSet.getCursorName() does not return the correct cursor name for Statements after the first execution > -------------------------------------------------------------------------------------------------------------------------- > > Key: DERBY-1183 > URL: http://issues.apache.org/jira/browse/DERBY-1183 > Project: Derby > Type: Bug > Versions: 10.2.0.0 > Reporter: Kathey Marsden > > For client, if the cursor name is set with java.sql.Statement.setCursorName() the name set by the user only applies to the first execution. Subsequent executions use the default cursor name. To reproduce run the progam below as follows: > D>java -Dframework=DerbyNetClient GetCursorName > 10.2.0.0 alpha > Apache Derby > Apache Derby Network Client JDBC Driver > rs.getCursorName():MyCursor > rs.getCursorName():SQL_CURLH000C2 > With embedded it is ok: > D>java GetCursorName > 10.2.0.0 alpha > Apache Derby > Apache Derby Embedded JDBC Driver > rs.getCursorName():MyCursor > rs.getCursorName():MyCursor > import java.sql.Connection; > import java.sql.DatabaseMetaData; > import java.sql.ResultSet; > import java.sql.SQLException; > import java.sql.Statement; > import org.apache.derbyTesting.functionTests.util.TestUtil; > class GetCursorName > { > > public static void main (String args [])throws Exception > { > testGetCursorName(); > } > > public static void testGetCursorName() throws SQLException > { > > Connection conn = TestUtil.getConnection("wombat","create=true"); > Statement stmt = null; > ResultSet rs = null; > DatabaseMetaData md = conn.getMetaData() ; > System.out.println(md.getDatabaseProductVersion()); > System.out.println(md.getDatabaseProductName()); > System.out.println(md.getDriverName()); > > stmt = conn.createStatement(); > // Setting the cursor name works for one execution ok. > stmt.setCursorName("MyCursor"); > rs = stmt.executeQuery("select count(*) from sys.systables"); > System.out.println("rs.getCursorName():" + rs.getCursorName()); > rs.close(); > //Executing another query seems to clears the cursor name. > // getCursorName() will print the default cursor name SQLXXX. > rs = stmt.executeQuery("select count(*) from sys.systables"); > System.out.println("rs.getCursorName():" + rs.getCursorName()); > rs.close(); > stmt.close(); > conn.close(); > } > > } > I noticed this bug when coverting the checkDataSource test for client. > I will change that test to set the cursor name for each execution for client. -- 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