Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 17608 invoked from network); 12 May 2006 17:08:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 May 2006 17:08:42 -0000 Received: (qmail 89004 invoked by uid 500); 12 May 2006 17:08:41 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 88962 invoked by uid 500); 12 May 2006 17:08:40 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 88944 invoked by uid 99); 12 May 2006 17:08:40 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 May 2006 10:08:40 -0700 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 32.97.182.143 is neither permitted nor denied by domain of Stan.Bradbury@gmail.com) Received: from [32.97.182.143] (HELO e3.ny.us.ibm.com) (32.97.182.143) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 May 2006 10:08:35 -0700 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e3.ny.us.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k4CH8BXU023833 for ; Fri, 12 May 2006 13:08:11 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay02.pok.ibm.com (8.12.10/NCO/VER6.8) with ESMTP id k4CH8Bxo235690 for ; Fri, 12 May 2006 13:08:11 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.12.11/8.13.3) with ESMTP id k4CH8BKE008511 for ; Fri, 12 May 2006 13:08:11 -0400 Received: from [127.0.0.1] (bradbury-lt1.usca.ibm.com [9.72.133.67]) by d01av04.pok.ibm.com (8.12.11/8.12.11) with ESMTP id k4CH89Or008270 for ; Fri, 12 May 2006 13:08:11 -0400 Message-ID: <4464C0F4.7010602@gmail.com> Date: Fri, 12 May 2006 10:08:04 -0700 From: Stanley Bradbury User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Derby Discussion Subject: Re: A question regarding RuntimeStatistics() References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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 Hi Ateesh - I am looking into this. I have gotten the same results as you and will investigating how to obtain runtime statistics output form a JDCB program. Stan [EOM] Ateesh_Verma@rapid7.com wrote: > > Hi, > > I am trying to get runtimestatistics for a PreparedStatement on a jdbc > connection. Looks like the RUNTIMESTATISTICS() function completely > ignores PreparedStatement(s). > Here is the code snippet: > > conn = DBManager.getConnection(); > Statement stmt = conn.createStatement(); > > stmt.executeUpdate("CALL > SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1)"); > stmt.executeUpdate("CALL > SYSCS_UTIL.SYSCS_SET_STATISTICS_TIMING(1)"); > > PreparedStatement pstmt1 = conn.prepareStatement("SELECT > user_name FROM users"); > rs = pstmt1.executeQuery(); > > while (rs.next()) > System.out.println(rs.getString(1)); > > rs = stmt.executeQuery("VALUES > SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS()"); > > if (rs.next()) > System.out.println(rs.getString(1)); > > > Here is the output I get: > > Statement Name: > null > Statement Text: > CALL SYSCS_UTIL.SYSCS_SET_STATISTICS_TIMING(1) > Parse Time: 0 > Bind Time: 0 > Optimize Time: 0 > Generate Time: 0 > Compile Time: 0 > Execute Time: 0 > Begin Compilation Timestamp : null > End Compilation Timestamp : null > Begin Execution Timestamp : null > End Execution Timestamp : null > Statement Execution Plan Text: > null) > > When I executed the query as a regular Statement, it worked fine. > > Any ideas ?