Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Samuel;Johnson;35;C:/temp/Samuel_Johnson.txt
David;Palmer;43;C:/temp/David_Palmer.txt
Samuel;Johnson;35;C:/temp/Samuel_Johnson.txt
David;Palmer;43;C:/temp/David_Palmer.txt
java.sql.SQLException: Unable to convert between java.io.File and JAVA_OBJECT.
Hi,
I've solved it by adding a tJavaRow with following content, before tMap:
java.io.File file = new java.io.File(((String)globalMap.get("tFileInputRaw_1_FILENAME_PATH"))); java.io.FileInputStream fis = new java.io.FileInputStream(file); int fileLength = (int) file.length(); byte[] incoming_file_data = new byte[fileLength]; // allocate byte array of right size fis.read(incoming_file_data, 0, fileLength ); // read into byte array fis.close(); output_row.content = incoming_file_data;
I attach sample job screenshot.
1) tFileList loops through files to load
2) tFileInputRaw reads each file as Object
3) tJavaRow converts Object to byte[]
4) tMap retrieves byte[]
5) tOracleOutput stores byte[] column as BLOB DB internal type
Hope it helps!