Performing JDBC Adapter inbound when Date is the primary key for customer table
Vinod_Valecha 270002HC72 Visits (2702)
When a field of Date format is the primary key for the table to be polled in the JDBC adapter inbound scenario, many users see an invalid date exception getting thrown and the adapter is not able to poll the event table.
Below is the exception that user see getting thrown when date is the primary key:
This exception is seen because of the mismatch of the DateFormat in the Business Object Application specific information (ASI) and the DateFormat at the event table ObjectKey field.
This post will explain the steps in detail that one has to follow to perform JDBC adapter inbound when Date is the primary key for the table
Steps to follow :
1. Run the external service wizard to specify the configuration details for database connection.
2. Select the table with primary key as Date, during EMD mapping change the Date datatype from String to SDO Date. Now complete the standard EMD inbound to generate the adapter export.
3. After adapter export is created, click on "Data Types" under the adapter generated artifacts. It will show you all the business objects generated for the current module.
4. Right Click on the business object containing Date as the primary and Open it in Business Object Editor.
5. Right click on the Date field in the business object and slect "Show In--> Properties View". This will open the date field in Properties view.
6. Under the Properties View select the "Application Info" tab.
7. Expand on "JDBC ASI Schema" and right click on "JDB
8. Select DateFormat and in "Extension details" specify the dateFormat in the text value field e.g "yyyy-MM-dd". This dateFormat should be the same as the one used in the event table for the ObjectKey column. Having any other DateFormat in the ASI will result into in-valid Dateformat Exception which I have described earlier.
9. Save the business object and now you are ready to deploy the JDBC adapter for performing inbound polling.
Above steps will ensure that JDBC adapter polls the event table correctly for the customer table which contains a field of Date format as the primary key.