官术网_书友最值得收藏!

The Customer database

Examples in this chapter will use a database called CUSTOMERDB. This database contains tables to track customer and order information for a fictitious store. The database uses JavaDB for its RDBMS, since it comes bundled with GlassFish, but it can be easily adapted to any other RDBMS.

A script is included with this book's code download to create this database and pre-populate some of its tables. Instructions on how to execute the script, and add a connection pool and data source to access it are included in the download as well.

The schema for the CUSTOMERDB database is depicted in the following diagram:

As can be seen in the diagram, the database contains tables to store customer information such as name, address, and email address. It also contains tables to store order and item information.

The ADDRESS_TYPES table will store values such as "Home", "Mailing", and "Shipping", to distinguish the type of address in the ADDRESSES table; similarly, the TELEPHONE_TYPES table stores the "Cell", "Home", and "Work" values. These two tables are prepopulated when creating the database, as well as the US_STATES table.

For simplicity, our database only deals with U.S. addresses.

主站蜘蛛池模板: 沽源县| 旬邑县| 洛宁县| 江山市| 乳山市| 黄石市| 安丘市| 高唐县| 萍乡市| 乌拉特后旗| 墨江| 长阳| 东阳市| 民勤县| 东源县| 万载县| 苍梧县| 屏东市| 双牌县| 侯马市| 泸水县| 平阳县| 榕江县| 北安市| 武隆县| 青铜峡市| 龙海市| 罗定市| 东海县| 怀远县| 独山县| 衡阳市| 团风县| 库尔勒市| 阿尔山市| 宁远县| 吉安市| 萍乡市| 吉安县| 哈尔滨市| 北票市|