Preparations

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:

  1. 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.

  2. A Java skeleton class de.hdm_stuttgart.mi.sd1.employeecompany.Xml2Rdbms containing boilerplate code being related to Jdom and Jdbc.

Description

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:

  1. 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.

  2. 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!