Mysql byte array storage

天大地大妈咪最大 提交于 2019-11-29 17:17:24

问题


I have a byte array created in Java. It represents content of some file. I don't know exactly the maximum size of this array. It can be different sizes. I want to store it in mysql. What type should I use in mysql?


回答1:


Use BLOB, medium blob , varbinary

Mysql Choosing the Right Type for a Column




回答2:


Use varbinary to store byte arrays of arbitrary length in MySQL.




回答3:


use a blob field

java serialblob

mysql blob



来源:https://stackoverflow.com/questions/11309040/mysql-byte-array-storage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!