Copyright (c) SEMM NL All rights reserved.
Author : Paul Hamaker. Part of JavaLessons.com
The gist. We want a phone-number lookup on just a first name.
sdb.war contains the test.html file shown at the top of the picture.
When the form is sent, it is to be handled by dbsurf.
The name sent is retrieved...
and used in the SQL.
close database resources as soon as you don't need them anymore.
We want current info presented to the user, so we do this to inhibit browser + proxy caching. No guarantees, however.
Load the driver class...
A type 2 driver is used most of the time, but check your database/application server vendor's docs to make sure.
Don't forget HttpServlet's init.
The database used here is JBoss' Hypersonic default database.