I want to use a binary file as an input and then load in a postgreSQL database. The binary file has the following format when converted to ASCII Name Marc ID 00000000 Age 30 The type and size in bytes of each field are already specified. what type of file in the metadata section in the repository do I need to use to specify the schema of the binary file Thank you for your help
the link is dead, where was pointing.
I need to migrate binary files (pdfs, txt,...) into a Postgres Database (bytea). How does this work, is it even possible?
I use this routine to put binary images into a MYSql database
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;
}
}
In a tMap I then call it on the output using ImageUtil.getByte(file_path) where file _path is the full file path to your file. The output column is a byte array byte[]
Hi
If the data is the file path of binary file, janhess's solution is good.
If you are migrate binary file from database to another database, set the type as byte[], db type as Blob or Clob on the schema of input/output db component.
Best regards
Shong