Hi,
Iam getting this error …
Reason: Can’t obtain DBConnection object: “dbConnection”
at org.jetel.graph.Phase.init(Phase.java:161)
at org.jetel.graph.runtime.WatchDog.executePhase(WatchDog.java:564)
at org.jetel.graph.runtime.WatchDog.call(WatchDog.java:155)
at org.jetel.graph.runtime.WatchDog.call(WatchDog.java:70)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: Can’t obtain DBConnection object: “dbConnection”
at org.jetel.component.DBInputTable.init(DBInputTable.java:171)
at org.jetel.graph.Phase.init(Phase.java:158)
… 8 more
Hi My code is this…
DBConnection dbCon;
Phase PHASE_0 = new Phase(1);
// initialization; must be present
EngineInitializer.initEngine(null, null, null);
System.out
.println(“*******************************************************************************************”);
// create connection object. Get driver and connect string from cfg file
// specified as a first argument
dbCon = new DBConnection(“dbConnection”, “src/mysql.cfg”);
System.out.println(“…Db connections…”+dbCon);
try {
System.out.println(“Id of the DB Connection:::”+dbCon.getId());
dbCon.init();
} catch (Exception ex) {
ex.printStackTrace();
}
DataRecordMetadata metadata = new DataRecordMetadata(
“metadaat”, DataRecordMetadata.DELIMITED_RECORD);
metadata.addField(new
DataFieldMetadata(“Field1”,DataFieldMetadata.STRING_FIELD, null));
metadata.setFieldDelimiter(“,”);
metadata.setRecordDelimiters(“\n”);
TransformationGraph institutionOrphanCheckGraph = new TransformationGraph();
String outputFile1 = “C:/hanu/feeds/A.xls”;
String outputFile2 = “C:/hanu/feeds/A_B.xls”;
String outputFile3 = “C:/hanu/feeds/B.xls”;
String parentQuery=“select code from feed_institution”;
String childQuery=“select pub_code from ip_institutions”;
// Nodes…
DBInputTable parentDBReader = new DBInputTable(“parentReader”,dbCon.getId(),parentQuery);
Node parentDBReaderNode = parentDBReader;
DBInputTable childDBReader = new DBInputTable(“childReader”,dbCon.getId(),childQuery);
but this giingh error that : Can’t obtain DBConnection object: “dbConnection”