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.