- Integrated Computing Environments
- A Database in a Browser
- A Simple Web Application from Sun Microsystems
- JavaDB: Sun Microsystems Derby distribution
- Running the Application
- Derby and Support
A Simple Web Application from Sun Microsystems
The following sections describe a demo application available from the Sun Microsystems web site. The code runs only on the Mozilla Firefox browser, which is an open-source browser available for download here.
The example application simulates a tax return in which the data is stored in an instance of Derby. The tax authorities in numerous countries already support this type of application.
Here in Ireland, an application is available that allows you to assemble all the data required for a tax return; then when you’re ready you can securely transfer this data to the tax authority.
The automation level is such that tax refunds are automatically calculated and dispatched to the sender. Sadly, the same applies for tax underpayments.
It’s interesting to discuss the benefits that a client-side database brings to this type of application. The first is simplicity. A Derby database can be used to store all of the application data. This is generally preferable to using proprietary files located on the end user disk.
Why might this be so? One good reason is that the contents of a Derby database can be encrypted. It’s not so easy to protect the contents of PDF or Word files, for example. The problem of information security after using a given web application is often overlooked.
In other words, when I’ve completed my tax return a lot of information remains on my hard disk in what is often clear text. To say this is a security hazard is an understatement.
Another reason why a database is a good place for information is because the problem of data storage is the raison d’etre of databases! Relational databases represent a mature proven technology that has been around for a long time. So, using databases on the desktop is a logical next step for such applications.
Anyway, back to the sample Sun Microsystems application!
Figure 3 illustrates the first page of the application. Just follow the instructions on the Sun web site to download and install the program.
Figure 3 The example browser application
Notice in Figure 3 that the user interface is very much like that of a standard desktop application. The only difference in Figure 3 is that this application is served from the local hard disk, not from across a network. Of course, the application can be served from any desired location, but in this case it all resides on the client side.
To interact with the application, just follow the on-screen instructions; for example, to see some prepackaged data, press the Continue Return button. This will present you with a number of screens that contain some typical data. The thing about the data is that it is read from a Derby database. Any data updates are written to the same Derby database.
It’s instructive to look at the Java Console as you interact with the Derby tax application. If an instance of the Java Console doesn’t open automatically, just follow the instructions to open one.