Download this Maven skeleton archive, unzip it and import the
resulting sub directory Skeleton
as a Maven project into your
Eclipse workspace. This project contains:
A schema file src/main/resources/company.xsd
describing company and employee data as being provided in the sample
instance src/main/resources/employees.xml
.
A Java skeleton class
de.hdm_stuttgart.mi.sd1.employeecompany.Xml2Rdbms
containing boilerplate code being related to Jdom
and
Jdbc
.
This exercise's aim is to transfer XML file
data like being represented by src/main/resources/employees.xml
to a relational database system via Jdbc
. You are expected to
solve two tasks:
Create a SQL-DDL schema which best resembles the XML schema
src/main/resources/company.xsd
.
Hint: Since employees belong to a specific company (composition) you'll need two tables being connected by a foreign key relation.
Complete the implementation of
de.hdm_stuttgart.mi.sd1.employeecompany.Xml2Rdbms.java
to
read XML data and write it to your database server.
Hint: With
respect to the foreign key reference connecting employees and companies
you'll have to invent id
values for company datasets. This
may be accomplished by simply enumerating all companies appearing in
your XML input data.
Upon completion zip up your project directory and upload it to the E-learning system. Mind the remaining time! When the examination terminates no subsequent uploads will be possible!