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 !!!
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.