You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a special character such as ' is present in the data, and when I load the data using AnyDataToDbDataTransferBuilder() withTargetSqlTemplate(), program fails.
We need to escape the special characters (by adding an extra ') while the template is transformed into actual values.
In my case, I read a binary file, form template and load data into H2 database.
The text was updated successfully, but these errors were encountered:
you need to subclass BinaryFileReader and override a method called createRowInstance and inject your own version of Row or subclass InMemory Row there. For example if you have your customRow extends from InMemory Row then you can override it in BinaryFileReader class.
`
public class MyRow extends InMemoryRow{ @OverRide
public Object getValue(int columnIndex){
//// do check for your column and data type and escape the string accordingly here
}
}
public class MyBinaryFileReader extends BinaryFileReader{
public Row createRowInstance(){
return MyRow();
}
}
//use MyBinaryFileReader in AnyDataToDbDataTransferBuilder instead of BinaryFileReader
`
Handled the special character issue by overriding public Object getValue(int columnIndex) in my class EbcdicRow which extends InMemoryRow did the job. Thanks for the suggestion.
When a special character such as ' is present in the data, and when I load the data using AnyDataToDbDataTransferBuilder() withTargetSqlTemplate(), program fails.
We need to escape the special characters (by adding an extra ') while the template is transformed into actual values.
In my case, I read a binary file, form template and load data into H2 database.
The text was updated successfully, but these errors were encountered: