|
Class loading overview
You store application classes and resources by storing one or more
jar files in the database. Then your application can access classes loaded
by Derby from the jar file
and does not need to be coded in a particular way. The only difference is
the way in which you invoke the application.
Here are the basic steps.
- Create jar files for your application
Include any Java classes in a jar file that are intended for Derby class loading, except the following classes:
- Add the jar file or files to the database
Use a set of procedures to install, replace, and remove jar files in a database. When you install a jar file in a database, you give it a Derby jar name, which is an SQL92Identifier.
- Enable database class loading with a property
Once you have added one or more jar files to a database, you must set the database jar "classpath" by including the jar file or files in the derby.database.classpath property to enable Derby to load classes from the jar files.
- Code your applications
In your applications, you load the classes either by indirectly referencing them in the code or by directly using java.lang.Class.forName.
|