1
votes

I use JPA to persist my data to a MySQL database and it all works pretty fine. Now I need to store a couple of configurations on the system the program is executed from.

In past I would have created a settings.ini or a settings.xml file and pretty much stored my stuff into it manually. But now I am asking myself whether it is possible to create a second persistence unit in the persistence.xml which would enable me to store my data into an xml-file.

Is that possible? Can I create a persistence unit that puts my data in an xml file instead of a database?

1
never heard of anything like this, but maybe you can do it using something like this csv-jdbc.com/stels_xml_jdbc.htm - Leo
if it works, don't forget to tell us :-) - Leo
I think this matter may be better solved with XPath and XQuery. - Melauki Mawi
@MelaukiMawi Thanks for the tip! Will try myself with that! - Socrates

1 Answers

0
votes

Thanks to @MelaukiMawi! The right way would be to create and manage an XML file with XPath and XQuery.