-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inserts into databases (H2, Oracle) using templates fails when special characters(') is present in data #8
Comments
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 MyBinaryFileReader extends BinaryFileReader{ //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: