Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 85111 invoked from network); 1 Aug 2006 18:36:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Aug 2006 18:36:28 -0000 Received: (qmail 17606 invoked by uid 500); 1 Aug 2006 18:36:28 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 17574 invoked by uid 500); 1 Aug 2006 18:36:27 -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 17565 invoked by uid 99); 1 Aug 2006 18:36:27 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Aug 2006 11:36:27 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [32.97.182.141] (HELO e1.ny.us.ibm.com) (32.97.182.141) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Aug 2006 11:36:26 -0700 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e1.ny.us.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k71Ia3sV019642 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Tue, 1 Aug 2006 14:36:04 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.13.6/NCO/VER7.0) with ESMTP id k71Ia37c161240 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 1 Aug 2006 14:36:03 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id k71Ia2Dg010771 for ; Tue, 1 Aug 2006 14:36:02 -0400 Received: from [127.0.0.1] (DMCSDJDT41P.usca.ibm.com [9.72.133.68]) by d01av02.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k71Ia1a8010620 for ; Tue, 1 Aug 2006 14:36:02 -0400 Message-ID: <44CF9F0E.6080606@apache.org> Date: Tue, 01 Aug 2006 11:35:58 -0700 From: Daniel John Debrunner User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en-us, en, de MIME-Version: 1.0 To: derby-dev@db.apache.org Subject: Re: Checking for required classes from within Derby? References: <44CF9A97.9090909@gmail.com> In-Reply-To: <44CF9A97.9090909@gmail.com> X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii 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 Army wrote: > As part of my work for DERBY-688 I've made some slight changes to the > XML operators that were added in DERBY-334 and I've also added a new > operator, XMLQUERY. [snip] > While this works, I can't help but wonder if Derby has some sort of > existing mechanism/utilities to check for the existence of required > classes in a cleaner (and perhaps more correct?) way. > > Does anyone know if such a utility/mechanism exists, and if so, can I > get some pointers to code/documentation? I admit I haven't done much > searching of the code yet; I figured I'd start with the list and maybe > save some time... Derby's loading of modules from modules.properties has a mechanism where a module is not loaded if its declared list of classes are not loadable. E.g. derby.module.jdbcJ2=org.apache.derby.jdbc.Driver20 derby.env.jdk.jdbcJ2=2 derby.env.classes.jdbcJ2=java.sql.Driver Only load the org.apache.derby.jdbc.Driver20 module if java.sql.Driver is loadable. So maybe you could look at that code to see if it helps. Otherwise the utility class org.apache.derby.iapi.services.loader.ClassInspector has some methods, you could add a new utility method there. Dan. PS. Tthis code comment is technically incorrect, JDBC 3 has nothing to do with JAXP, JAXP api is driven by the JDK level not the JDBC level. * Note: The JAXP API and implementation are * provided as part the JVM if it is JDBC 3.0 or * greater.