Hi i want to find values from the table according the input from csv file…
I wrote code for that but it is not working and giving error that…Lookup Reason: Lookup table “LookupTable” not found.
Part of my Code is
DataRecordMetadata metaDataParentChild;
DataRecordMetadataXMLReaderWriter reader=new DataRecordMetadataXMLReaderWriter();
try{
metaDataParentChild=reader.read(new FileInputStream(“C:\\FeedVaidationTool\\src\\com\\mps\\pubstats\\metadata\\parent_child.fmt”));
}catch(IOException ex){
System.err.println(“Error when reading metadata!!”);
throw new RuntimeException(ex);
}
if (metaDataParentChild==null){
throw new RuntimeException(“No INPUT metadata”);
}
TransformationGraph institutionGraph = new TransformationGraph();
Edge egde1 = new Edge(“InEdge1”, metaDataParentChild);
Edge egde2 = new Edge(“OutEdge2”, metaDataParentChild);
// //Nodes…
DelimitedDataReader deLimitedReader= new DelimitedDataReader(“DataParser”,
“c://hanu//feeds//consortium_members.200802.csv”);
deLimitedReader.setSkipFirstLine(true);
//System.out.println(“Skip First Line :::”+feedController.headingIncluded);
Node nodeRead = deLimitedReader;
RecordTransform parentChild =new ParentChildReformat();
DBLookupTable lookup=new DBLookupTable(“LookupTable”,dbConnection.getConnection(dbConnection.getId()),metaDataParentChild,"select id from accounts where code=‘10002’ ");
//Node parentChildReformatNode = parentChildReformat;
try {
lookup.init();
} catch (ComponentNotReadyException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
lookup.setLookupKey(“Field1”);
String joinKeys={“Field1”};
LookupJoin lookUpJoin=new LookupJoin(“lookup”,lookup.getId(),joinKeys,parentChild);
Node dataWriter = new DelimitedDataWriter(“DataWriter3”, “c:\\hanu\\feeds\\out_put\\test.xls”,
false);
/*
DBOutputTable dbFilter = new DBOutputTable(“DBOutPutTable1”, “Conn0”,
“feed_errors”);
dbFilter.setDBFields(feedController.dbFields_FeedStatus);
dbFilter.setCloverFields(feedController.dbFields_FeedStatus);
Node dbFilterOutPut = dbFilter;
//String deDup1={“Field0”};
Trash trash=new Trash(“trash”);
Node trashNode=trash;*/
egde1.connectReader(nodeRead, 0);
egde1.connectWriter(lookUpJoin, 0);
egde2.connectReader(lookUpJoin, 0);
egde2.connectWriter(dataWriter, 0);
nodeRead.addOutputPort(0, egde1);
lookUpJoin.addInputPort(0,egde1);
lookUpJoin.addOutputPort(0, egde2);
dataWriter.addInputPort(0,egde2);
// add Edges & Nodes & Phases to graph
try {
institutionGraph.addConnection(dbConnection);
institutionGraph.addPhase(PHASE_0);
PHASE_0.addNode(nodeRead);
PHASE_0.addNode(lookUpJoin);
PHASE_0.addNode(dataWriter);
institutionGraph.addEdge(egde1);
institutionGraph.addEdge(egde2);
// institutionGraph.addEdge(egde6);
System.out.println(“Graph is created properly”);
} catch (GraphConfigurationException ex) {
System.out.println(“::::::::::::::::::::::::::File Not Found:::::::::::::::::::::::::::::::::::::::::::::::::::::::”);
ex.printStackTrace();
}
Plase help…
Thanks .