Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 2316 invoked from network); 14 Apr 2010 21:04:38 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 14 Apr 2010 21:04:38 -0000 Received: (qmail 62455 invoked by uid 500); 14 Apr 2010 21:04:37 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 62424 invoked by uid 500); 14 Apr 2010 21:04:37 -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 62417 invoked by uid 99); 14 Apr 2010 21:04:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Apr 2010 21:04:37 +0000 X-ASF-Spam-Status: No, hits=-3.1 required=10.0 tests=AWL,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [192.18.6.24] (HELO gmp-eb-inf-2.sun.com) (192.18.6.24) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Apr 2010 21:04:29 +0000 Received: from fe-emea-09.sun.com (gmp-eb-lb-1-fe1.eu.sun.com [192.18.6.7] (may be forged)) by gmp-eb-inf-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id o3EL45MK011361 for ; Wed, 14 Apr 2010 21:04:06 GMT MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from conversion-daemon.fe-emea-09.sun.com by fe-emea-09.sun.com (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul 2 2009)) id <0L0V00700WUJS800@fe-emea-09.sun.com> for derby-dev@db.apache.org; Wed, 14 Apr 2010 22:03:28 +0100 (BST) Received: from [192.168.1.134] (c786A47C1.dhcp.bluecom.no [193.71.106.120]) by fe-emea-09.sun.com (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul 2 2009)) with ESMTPSA id <0L0V00041X5RO500@fe-emea-09.sun.com> for derby-dev@db.apache.org; Wed, 14 Apr 2010 22:03:28 +0100 (BST) Date: Wed, 14 Apr 2010 23:03:27 +0200 From: Knut Anders Hatlen Subject: Re: Get database name In-reply-to: Sender: Knut.Hatlen@Sun.COM To: derby-dev@db.apache.org Message-id: <4BC62D9F.6040205@sun.com> References: <4BC5790B.9090102@sun.com> User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.1.9) Gecko/20100318 Thunderbird/3.0.4 On 04/14/10 22:15, Eranda Sooriyabandara wrote: > Hi Knut, > Thanks. Also is there a way to get the current database name within the > code? > The purpose is to print the current database name to the log. Hi Eranda, It should be possible to call EmbedConnection.getDBName() from within the code as well, if a connection has been created. But exactly how to get the database name depends on where in the code you need to get it from. Is this question about DERBY-4601? If so, I guess that means you'll want to get it from InternalDriver and/or EmbedConnection. In InternalDriver, you typically have the URL and need to call the helper method getDatabaseName() to extract the name. In EmbedConnection, you can simply call getDBName() or tr.getDBName(). -- Knut Anders