A
A
Anton2015-12-15 00:58:37
Java
Anton, 2015-12-15 00:58:37

How to save a text file?

Good afternoon!
I am studying new technologies and now I decided to study JPA and in parallel the ObjectDB database. I managed to complete the connection and requests. But now I want to try to save a text file to the database. When executing the command, an error occurs. Is it possible to save a text file in ObjectDB?
Link to code

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2015-12-15
@MoonMaster

EMNIP, in order to save a direct file into your BookEntity, for example, then this same BookEntity must have a field for storing the file. The field must be of type byte[] (an array of bytes), and it must also be marked with the @Lob annotation. And then all your saving/reading comes down to writing/reading an array of bytes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question