How to store a file in the database with Grails

前端 未结 5 805
鱼传尺愫
鱼传尺愫 2021-01-12 23:55

I need to store a file in the database using Grails. So, do you know how I can do that? Which data type should I use in the domain class (byte[] might be a solution)?

5条回答
  •  囚心锁ツ
    2021-01-13 00:25

    I recently used byte[] in a domain class for storing file, it was working fine until i moved my application from "HSQLDB" to "Oracle express". On Oracle, byte[] was mapped to a raw object instead of blob... (not sure of what was exactly wrong) and I finally solve the problem by using a java.sql.blob

提交回复
热议问题