>I recently bought Sams Teach Yourself J2EE to learn the Enterprise Edition
> from scratch. The book has one main application that it develops. The
[quoted text clipped - 12 lines]
> anyone
> else encountered this? Any help would be appreciated. Thanks.
You might get a better answer on comp.lang.java.databases; someone there may
have used Derby. Or try looking for the Derby documentation; it must have
information on how to write the driver and protocol strings.
--
Rhino
I just ran into the same problem today. The following is what I did to
get it to the point where I could create the database and tables. Since
that is as far as I have gotten, I have no idea whether or not there
are any other changes that may need to be made. In particular, since
the type of the 'exact' column in the 'Matched' table changed from
boolean to smallint, there may be some other code that has to be
updated.
In CaseStudy/Day02/exercise/src/CreateAgency.java:
Redefined string constants:
private static final String driver =
"org.apache.derby.jdbc.ClientDriver";
private static final String protocol =
"jdbc:derby://localhost/sun-appserv-samples;create=true";
private static final String user = "APP";
private static final String password = "APP";
Redefined all the create table statements:
s.execute("create table Skill(name varchar(16) CONSTRAINT
pk_skill PRIMARY KEY, description varchar(64))");
s.execute("create table Location(name varchar(16)
CONSTRAINT pk_location PRIMARY KEY, description varchar(64))");
s.execute("create table Applicant(login varchar(16)
CONSTRAINT pk_applicant PRIMARY KEY, name varchar(64), email
varchar(64), summary varchar(512), location varchar(16), CONSTRAINT
fk_location FOREIGN KEY (location) REFERENCES Location(name))");
s.execute("create table ApplicantSkill(applicant
varchar(16), skill varchar(16), CONSTRAINT fk_applicant FOREIGN KEY
(applicant) REFERENCES Applicant(login), CONSTRAINT fk_skill FOREIGN
KEY (skill) REFERENCES Skill(name))");
s.execute("create table Customer(login varchar(16)
CONSTRAINT pk_customer PRIMARY KEY, name varchar(64), email
varchar(64), address1 varchar(64), address2 varchar(64))");
s.execute("create table Job(ref varchar(16), customer
varchar(16), description varchar(512), location varchar(16), CONSTRAINT
pk_job PRIMARY KEY (ref,customer), CONSTRAINT fk_customer FOREIGN KEY
(customer) REFERENCES Customer(login), CONSTRAINT fk_location_job
FOREIGN KEY (location) REFERENCES Location(name))");
s.execute("create table JobSkill(job varchar(16), customer
varchar(16), skill varchar(16), CONSTRAINT fk_job FOREIGN KEY
(job,customer) REFERENCES Job(ref,customer), CONSTRAINT
fk_skill_jobskill FOREIGN KEY (skill) REFERENCES Skill(name))");
s.execute("create table Matched(applicant varchar(16), job
varchar(16), customer varchar(16), exact smallint, CONSTRAINT
fk_job_matched FOREIGN KEY (job,customer) REFERENCES Job(ref,customer),
CONSTRAINT fk_applicant_matched FOREIGN KEY (applicant) REFERENCES
Applicant(login))");
In CaseStudy/Day02/exercise/build.xml:
Changed PointBasePool to DerbyPool
In CaseStudy/common/targets.xml:
Changed all instances of "com.pointbase.jdbc.jdbcUniversalDriver" to
org.apache.derby.jdbc.ClientDriver and all instances of
"jdbc:pointbase:server:" to "jdbc:derby:"