I need to store images in a database, so I decided with a table design to accommodate it. The table design is
FILE_ID INT,
FILE_NAME VARCHAR(200),
FILE_CONTENTS BLOB.
I'm using Oracle database. I think Oracle supports BLOB upto 2 GB of storage. I'm using hibernate as the JPA provider. The model class is annotated with Hibernate annotations where the blob field is with the byte[] (byte array type). If the image size is with few megabytes then the hibernate can bring the contents into the memory. If the size of the contents is more than the size of the jvm, how is hibernate accomplishing to bring the contents into the memory?