I am working on an application that will require storing xml in the database. The xml will contain user permissions that will be loaded into a POJO after the user logs in(Using JAXB). The permissions will be created/edited by the same application. We are using Oracle database. My question is what's the best way of storing XML in the database. Should I use XMLTYPE, or VARCHAR? Is there a better way to accomplish this. Thanks in advance for your advice.
P.S. The reason I am storing permissions in the XML because I want to be albe to add/change permissions without adding more columns to the permissions table.
An XML type is better than varchar. I don't follow you reason though. I understand not wanting to add columns, but you don't need to. What if you had a table permission_details with columns id, name and value? You'd just add a new row (name/value pair) for a given id and query directly. Managing security in the app is fine too, but you wouldn't need to add a column either way.