|
Creating an SQL-Java Gateway
This tutorial shows how to create an application that
can be used to execute any standard SQL statement against a
database that's running on a server. You can use an application
like this one to to view and modify the data in a database as
you're developing an application. In this article, this
application will be referred to as the SQL Gateway application,
and it only uses three components: a JSP, a servlet, and a
static Java class.
If you're working with a database that's hosted by an ISP, the
ISP will usually include an HTML-based way to work with the
database that's similar to this application. If not, you can
upload this application to work with the database. Either way,
this application illustrates most of the principles for using a
servlet to access data that's stored in a database on a server.
Pre-requisites
This tutorial is an excerpt from chapter 11 of Murach's Java
Servlets and JSP by Andrea Steelman and Joel Murach. It assumes
that you have a basic understanding of the Java language,
servlets, and JavaServer Pages. If you don't, you might be
interested in Murach's Beginning Java 2 or Murach's Java
Servlets and JSP.
Source code
Before you begin this tutorial, you may want to download the
source code for this application. That way, you can open the
source code in your favorite text editor to see how it all fits
together.
New on the Java Boutique:
New Review:
Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling
API boasts simplicity, ease-of-integration, a well-rounded feature
set, and it's free!
New Applet:
Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA
sequences into three useful formats.
Elsewhere on internet.com:
WebDeveloper Java
Lots of Java information on webdeveloper.com
WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.
ScriptSearch Java
Hundreds of free Java code files to download.
jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.
|