I have used tOracle input to extract data from Oracle DB.Then used tJavaFlex to split the data into multiple chunks of bytes.
Used the following code in Start and Main code.I have used the option Dynamic in Edit schema of the tJava Fex to get the column lists of the tables on the fly automatically
byte[] contentInBytes = tmpReadLine.getBytes();//Convert them to Byte array
ByteCount=ByteCount+contentInBytes.length; // Summation of line bytes read
if ( ByteCount > context.SplitByte ) { // Check if bytes read hasn't crossed the threshold ByteCount = 0;
fos.flush(); fos.close(); iterator = iterator+ 1;
// Threshold crossed write to new file fos = new FileOutputStream(context.TgtFilePath+"TargetFile_"+iterator+".csv"); } else { fos.write(contentInBytes); // else write to same file }
Now I do not want to hard-code the column names in the Main code portion of the tJavaFlex(as given in bold above).
What is the alternative solution to make the column names dynamic because I want to use the same Talend job for multiple data extraction