Import XML instances into RDBMS

Preparation

If you already started the first task just continue working on your project using IntelliJ. Otherwise read the first task regarding the skeleton project import.

Description

Write a Java application reading <examinations> document instances and writing their XML content to a relational database. Hints:

  • de.hdm_stuttgart.mi.sda1.Examination2Rdbms contains JDBC related connection parameters and boilerplate code.

  • Upon invocation class de.hdm_stuttgart.mi.sda1.Driver instantiates de.hdm_stuttgart.mi.sda1.Examination2Rdbms thereby:

    • Reading and parsing Schema/sampledata.xml.

    • Open a database connection to your local PostgreSQL server.

Tasks

Pre- insert Student data from Schema/schema.sql using your IDE prior to running your application. Implement the subsequently mentioned features. Each section adds points to your marking. Using PreparedStatement instances should be preferred.

  1. Read and insert <lecture id="nnn">XYZ</lecture> entries into your database.

  2. Read and insert <result lecture="113771" matriculationNumber="12345">x,y</result> entries into your database.

  3. Allow for multiple invocations: Import conflicts (i.e. duplicate lectures or marks) should create informal warnings but your application should try to continue anyway.

Hints
  • Executing de.hdm_stuttgart.mi.sda1.Driver calls de.hdm_stuttgart.mi.sda1.Examination2Rdbms.execute() already containing both your XML instance's root element and a database connection handle.

  • Even if your application just fills in e.g. lecture data you'll receive points. Also partly completed but not fully working code may contribute.

Solution upload

Upload your project using the first task. Enter either of the following two texts below:

  • I'm expecting points for my work on the current task.

  • I did not work on this task.

You may as well add other marking related comments.