In the previous chapter, we learned how to process query results with JDBC. In this chapter, we ll take these query results and put them to use in a multimedia application. The application we ll be developing, IconStore, will connect to a database, query for image data stored in database tables, and display the images on a canvas. It s all very simple, and it puts the JDBC to good use by building a dynamic application totally driven by data stored in tables. IconStore Requirements The IconStore application will utilize two database tables: ICONCATEGORY and ICONSTORE. The ICONCATEGORY table contains information about image categories, which can be items like printers, sports, and tools. The ICONSTORE table contains information about each image. Tables 8.1 and 8.2 show the database tables underlying data structures. Note that the CATEGORY column in the ICONSTORE is a foreign key into the ICONCATEGORY table. If the category ID for sports is 1 , you can obtain a result set containing all of the sports images by using this statement: SELECT ID, DESCRIPTION, ICON FROM ICONSTORE WHERE CATEGORY = 1 Table 8.1 The ICONCATEGORY table. Column Name SQL Type Description CATEGORY INTEGER Category ID Description of the image category Table 8.2 The ICONSTORE table. Column Name SQL Type Description ID INTEGER Image ID DESCRIPTION VARCHAR Description of the image CATEGORY INTEGER Category ID Binary image Now, let s take a look at what s going on in the application: An Icons menu, which is dynamically created by the ICONCATEGORY table, contains each of the image categories as an option. The user can select an image category from this menu to display the proper list of
Do you have a godaddy domain name? If you do, you have found the right web hosting provider for you.Our Godaddy Web Hosting packages are the best match to well known, affordable godaddy domain names.