Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Persisting data when data config/validation in contained in an xml file  RSS feed

Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have a webapp that validates and then uploads data (mostly in the form of spreadsheets). Each project has their own individual xml file that specifies what data is valid for the project. This xml file contains information such as required columns, recommended columns, acceptable values for a column, etc. We are currently a triple store to store the data and a rdbms to store the metadata (project information, individual data upload metadata, etc), however a customer wants to use mysql to store the data.

1. The data will need to be queryable. Therefore, I think the best option would be to create a db column for every "column" specified in the config xml. When uploading, a user will be inserting/uploading multiple rows, so I think that doing a batch csv load to mysql will be best. From testing, this was much faster then writing insert statements from the uploaded spreadsheet. Does this seem like the best option?

2. The xml files are mostly static, however there could be a column added or removed. Because of this, we need to verify that the database matches the config file whenever someone uploads data and throw an error if the database and config file don't match. How would you recommend doing this? Is fetching the column_name from INFORMATION_SCHEMA.COLUMNS and comparing them to the config file the best option? We would be using jdbc for the csv load, but jpa entities to represent the table. The other option would be to compare the Entity object properties to the config file (using reflection?).

Thanks in advanced!
The happiness of your life depends upon the quality of your thoughts -Marcus Aurelius ... think about this tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!