JDBC  «Prev  Next »

Lesson 1

Java Servlet Database Interaction

Servlets read from and write to Databases

Many people believe the most important use of servlets is to interact with databases, which is certainly a very important use. In this module, you will see how to do that.
The prerequisites for this course call for you to know some SQL and to have seen JDBC code before. If don’t have this knowledge, you will need to take what you see here at face value. We are using a number of classes that are part of the standard Java library for working with SQL, and you will learn how to use them for specific tasks. We will not explain every facet and detail of these classes and how they work.

When you finish this module, you will be able to:
  1. Explain how Java, servlets, JDBC, ODBC, and database software work together
  2. Set up an ODBC data source as a System DSN
  3. Decide whether it is appropriate to connect to your database in init() or getPost()
  4. Write code to connect to a database
  5. Write code to read from a database
  6. Write code to update records in a database