Before you start
If you're a developer interested in creating a Java analysis application that uses Derby to modify functions without modifying the core application code, this tutorial is for you. It's also for those interested in securing the Derby database in a signed .jar file.
In this tutorial, you'll build a dynamic Derby application and learn more about the dynamic abilities of the Java language through a Java analysis program that determines insurability of automobile drivers. The key concepts of this tutorial are creating dynamic functions in Derby and then calling these functions in your Java application.
As soon as you're able to store application logic (using functions) in your database, you'll discover how to modify the application logic, or the functions that your application uses, by modifying the .jar file. Modifying the functions allows your program to produce different results, without you having to modify the core application code. The ability to do this is a huge advantage for code maintenance.
Because this process requires working with a database in a .jar file, security is crucial. Toward the end of this tutorial, you'll create a signed .jar file and verify that it's genuine and hasn't been tampered with, assuring your content is safe.
The following topics are covered in this tutorial:
- Application overview, Derby refresher, and setup
- Analysis application
- Storing logic in Derby
- Changing the application logic
- Looking out for tampering
This tutorial assumes you're familiar with basic programming and Java concepts, including classes, methods, and variables. Knowledge of Java GUI programming is helpful, but not required. For more information, see the Resources section at the end of this tutorial.
To follow along with this tutorial, you'll need the following tools (see the Resources section for links to these downloads):
- Database. Obviously, you need Derby. Download Derby from Apache and the IBM DB2® JDBC Universal Driver, making sure you've set your class path appropriately by following the installation instructions.
- Java technology. Derby requires the use of Java code. Working on a Linux® box running Red Hat Fedora Core, the gcj compiler provided in the distribution was insufficient. Download the Java 2 Platform, Standard Edition (J2SE) Development Kit.
- GUI front end. The GUI front end isn't required. It is, however, a recommended download for your experience throughout this tutorial. Download the GUI and other miscellaneous application code.

