Internet Features   «Prev  Next»

Delivering Web pages with SQLJ - Exercise

Delivering Web pages with SQLJ

Create an applet using SQLJ

Objective: Add code to an applet using SQLJ.

Exercise scoring

This exercise is worth a maximum of 10 points.

Background/overview

In this lesson you have seen how to create an applet that queries the House-O-Pets data. In an earlier lesson, you saw how to use interMedia to deliver an image file from the database. Now you will use your knowledge to create an applet that delivers an image of the product based on the user's query criteria.

Download files


Download the partially completed applet.

Instructions


Download the partially completed applet. Add the SQLJ component to the applet. Then answer the following questions.
  1. What is the advantage of using SQLJ and Java over using JDBC and Java?
  2. What other information would you recommend displaying along with the product image?

Submitting your exercise

Copy your applet source code and your answers into the box below. Click the Submit button to submit your exercise.
Question 1: The advantage of using SQLJ and Java over using JDBC and Java is that you are coding only SQL commands instead of coding the intermediate steps (such as OPEN, PARSE, FETCH, and so on) that are required when coding JDBC and Java.
Question 2: Other information that might be displayed along with the product image would include the product number, name, the current number in stock, comments about care and feeding (for pets), and the price.