Example Programs

# The Working With Derby Sample Programs

The programs in this directory are described in the the Working With Derby manual. Please see this document for more information.

- WwdEmbedded.java

  A very basic JDBC program that uses Derby. This is the primary program example used in the JDBC sections of Working With Derby. It is described in detail in that document.

- WwdClientExample.java

  This is an example of what the WwdClient.java program created as part of one of the Working With Derby activities will look like. A working copy of that code is provided here for people interested in examining the code without performing the edits described in the activity.

- WwdUtils.java

> These are utility methods used by the Working With Derby programs that are not described in the document. The processing performed by these methods does not demonstrate basic JDBC processing and so is outside the scope of an introductory document like Working With Derby. These methods provide environment validation and manage user input so the program is more robust. The code is provided here for people interested in examining the processing. It contains three methods:
> 1. getWishItem - Prompts for user input and returns the entered text, if any, to the calling program. Handles I/O Exceptions and insists that some text is entered.
> 2. wwdChk4Table - Checks if the table needed by the program already exists and is defined properly. Handles certain errors that could occur.
> 3. main - Allows standalone testing of the getWishItem method.