Unable to Insert Image into Database

Hi all,

I need to read an image(jpg/jpeg/png) from my local machine and insert it into database and then fetch it from database using an adapter and then write in my local machine.

Should i write a custom service (Java Service) to read the image file…?

Or the below method would work…

pub.getFile–>read as bytes
base64encode—>encode the value(string)
insert into DB–>clob datatype
fetch from DB—>adapter
base64decode—>generate the value(obj)
writeToFile—>write to local location

Please tell if the above method would work OR is there any other better Method…? :idea:

The flow seems to be good interms of design (I have to develop and test) but try to check blob instead of clob data type in db.

Also writing custom java service would help but I would prefer either go with the flow service or write db stored procedures which will ease your implementation.

For Images only Blob format will work as expected not Clob.

BLOB stores as Large Object in bit-streams.
CLOB stores as Large Object in character streams.

Regards,
Syed