Hi All,

Currently in JdbcPOJOInsertOuput operator we cannot configure JdbcFieldInfo
via properties.xml and the user has to do the necessary coding in his
application.
To start solving this issue I followed the steps mentioned on
http://docs.datatorrent.com/application_packages/#operator-properties

And added the following code in AbstractJdbcPOJOOutputOperator (just for
learning/testing)

public void setFieldInfo(int index, String value)
  {
    LOG.info("In setting field info");
    JdbcFieldInfo jvalue = new JdbcFieldInfo();
    StringTokenizer st = new StringTokenizer(value);
    jvalue.setColumnName(st.nextToken());
    jvalue.setPojoFieldExpression(st.nextToken());
    jvalue.setType(FieldInfo.SupportType.valueOf(st.nextToken()));
    jvalue.setSqlType(Integer.parseInt(st.nextToken()));

    final int need = index - fieldInfos.size() + 1;
    for (int i = 0; i < need; i++) {
      fieldInfos.add(null);
    }
    fieldInfos.set(index, jvalue);
  }

In my corresponding application I added the following lines in
properties.xml:
<property>
    <name>dt.operator.jdbcOutput.fieldInfo[0]</name>
    <value>customerPhone customerPhone STRING 0</value>
  </property>
//Added similar properties for remaining field infos.


The issue I am facing is that setFieldInfo() is not being called. Am I
missing something?

Regards,
Hitesh

Reply via email to