Hi, i am using the primefaces fileupload widget, so users can upload attatchment files. right now, i save the files on the filesystem and i persist the path to the file in the database. is there a way to save files as BLOB in relational database? Thank you for your answers! asked 26.05.2016 at 16:59 joha0123 |
Yes, it's possible, e.g. by using JPA (aka Ivy Persistence). You have to write the JPA class by yourself (instead of using the persistence editor) so that you can use the @Lob annotation on the field. BUT: If there is no real requirement (e.g. transaction support) to store files in the database, the filesystem is a good choice. It’s a common question, the question is-it-a-bad-practice-to-store-large-files-10-mb-in-a-database on stackexchange could help. answered 31.05.2016 at 12:59 Flavio Sadeghi ♦♦ |
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Tags:
Asked: 26.05.2016 at 16:59
Seen: 2,489 times
Last updated: 31.05.2016 at 12:59