How to insert image as blob in DB2?

橙三吉。 提交于 2019-12-11 13:18:49

问题


I want to insert a PNG image in DB2. I am able to insert image in my SQL using Load File function. But I don't know how to insert image in DB2 column.


回答1:


Check out the sample code provided with DB2, for example DtLob.java




回答2:


db2 sql query to insert image into table
create table table_name(column_name BLOB)        /* BLOP is a data type
insert into table_name(column_name)values(blob('c:\data\winter.jpg'))

c:\data\winter.jpg is a path location , winter.jpg - image_name



来源:https://stackoverflow.com/questions/18311648/how-to-insert-image-as-blob-in-db2

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