How to insert image as blob in DB2?

2019-07-24 14:03发布

问题:

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



标签: db2 blob