Banner

 

Java files

Support for Chapter 17: SQL and Java

A zip file contains the following

BlueJ packages

Java code

SQL

Test is the table used with the Database package.

CREATE TABLE test (
name VARCHAR(50),
PRIMARY KEY(name));

The following three tables are used with the Map Collection package.

CREATE TABLE country(
cntrycode CHAR(2) PRIMARY KEY,
cntryname VARCHAR(20));

CREATE TABLE map(
mapid INT PRIMARY KEY,
mapscale INT,
maptype VARCHAR(20));

CREATE TABLE mapCountry(
mapid INT,
cntrycode CHAR(2),
CONSTRAINT fk_map FOREIGN KEY(mapid) REFERENCES map(mapid),
CONSTRAINT fk_country FOREIGN KEY(cntrycode) REFERENCES country(cntrycode));

INSERT INTO country VALUES ('at', 'Austria');
INSERT INTO country VALUES ('be', 'Belgium');
INSERT INTO country VALUES ('fr', 'France');
INSERT INTO country VALUES ('de', 'Germany');
INSERT INTO country VALUES ('nl', 'Netherlands');
INSERT INTO country VALUES ('ch', 'Switzerland');

 

This page is part of the promotional and support material for Data Management (fifth edition) by Richard T. Watson
For questions and comments please contact the author

Date revised: October 24, 2009