Export image file to binary field

One Star

Export image file to binary field

Hi and thank you for this real great tool.

I have to migrate some contents from MySQL to Ms SQL data base
Into my MySQL data base i have only paths of some pictures, i would like to stock the binary of pictures into my MS SQL database.
I know that it is possible with TftpfileList or TfileList but have no idea how to convert content and how should i order and arrange those components to do it.
If some one can share his experience or help me to do that.
(PS : I'm using Talend Open Studio)
Thanks !!!
One Star

Re: Export image file to binary field

Yes I've done this - I'll post the details on Monday as I'm just on my way home.
One Star

Re: Export image file to binary field

This is what I did to populate a ms SQLserver database.
It requires a routine ImageUtil
// template routine Java
package routines;
import java.io.FileInputStream;
import java.io.File;
import java.io.FileNotFoundException;
public class ImageUtil {
public static byte[] getByte(String filepath) {
byte[] b=null;

try {
FileInputStream fis = new FileInputStream(filepath);
b=new byte;
fis.read(b);
} catch (Exception e) {
e.printStackTrace();
}
return b;
}
}
This is used to create the image as a byte array in tMap4 for input to the database column which has a datatype of image.
One Star

Re: Export image file to binary field

Thank you very much !!
I will try that.
Highlighted
One Star

Re: Export image file to binary field

Hi,my team is also  trying to do this.It will be great if you can elaborate the process.