The BlobView servlet

The BlobView class as shown in the previous chapter, is a servlet that receives a single parameter that represents an ID number for a movie stored in the database. The ID number is used to find the BLOB record in the database, retrieve it, and write it to the output stream for the HTTP response (see Figure 35-1).

Figure 35-1. The BlobView servlet

The movie ID number (movie_id) is retrieved from a request parameter, so the URL to call the BlobView servlet is as follows:

http://serverName/ServletExamples/BlobView?movie_id=801

The job of finding and retrieving the BLOB and writing it to the output stream is left to an associated ...

Get J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.