apache > db
Apache Derby Fortune Server Tutorial
 
Font size:      

Introduction

Goals

The Getting Started section walked through configuring Tomcat to get the Fortune Server up and running, but it didn't explain anything under the hood. This section explains how the Fortune Server embeds Derby in Tomcat and it describes the sample web applications. The sections are organized as shown below:

  • The Basics section describes a few Tomcat concepts to get you going with Derby.
  • The Embed Derby section explains how the embedded Derby JDBC driver gets loaded when Tomcat starts up and how Derby gets shutdown when Tomcat is stopped.
  • The Web Apps section describes the two web applications that come with the Fortune Server.

Fortune Server Tomcat Source

The FORTUNE_HOME/java directory contains source code for the LifecycleEvent interface and for the web applications:

examples/tutorial/derby/
ServerLifecycleListener.java
Implements the Tomcat LifecycleEvent interface.
ClientApps FortuneQuery and FortuneServer JSP