Java Reference
In-Depth Information
Lab 18.3: The Reminder Application
This lab is a continuation of Lab 16.5, A Reminder Application . The
Reminder application you wrote in Lab 16.5 is useful to the extent that
your reminders are remembered and successful as long as the program is
running. After you shut down the program, all of your reminders are lost.
In this lab, you will use a database to keep track of the reminders.
1. Start by creating a new database. Add a table called Reminders that
contains columns for keeping track of the time and message of each
reminder. You might want to add a number column to the table to
represent a primary key.
2. When a user creates a reminder, add the information to the
database. (Your program should still do whatever it performed
previously.)
3. When a reminder goes off, delete it from the database.
4. Now, when the program is exited, all upcoming reminders are
maintained in the database. When the program starts up, it should
retrieve the reminders from the database and schedule them.
5. If a reminder should have occurred while the program was not run-
ning, have the reminder displayed immediately when the program
starts up.
6. Test your program and make sure it works successfully.
Your Reminder application is now useful. Reminders are not lost,
although they might be missed if the program isn't running when a
reminder is scheduled. (However, that's true with any reminder-type
application.)
Summary
The JDBC API contains classes and interfaces for connecting to a data-
base and performing SQL statements.
■■
You need a JDBC driver for a Java application to connect to a database.
There are four types of drivers referred to as Type 1, 2, 3, and 4. Each
type of driver has its benefits.
■■
Search WWH ::




Custom Search