Java Integration
Transform Anything with Java
Oracle Service Bus Database to File
In order for OSB to connect to databse using adapters, we need to create the JCA artifact using JDeveloper and import them to OSB.
1. Open JDeveloper anc create an empty SOA project.
2. We will create DB Read adapter and File Write adapter. Folow the below steps.
First we will create DB Adapter for polling.








3. Once the DB Adapter is done, we can start with the File adapter as per the below steps.





4. Now let us import the artifacts using the below steps. We wiil import the DB Read JCA and the File Write JCA into the OSB.






5. Create a business Service Manually. Follow the below steps.


6. Let us leave the File Transport Configuration empty. We will update the Transport details in the Proxy Service.


7. It is better to commit the session.
8. The next step is to create the proxy service. We will generate this from the JCA.
9. Select the readFrinDB JCA file.

10. On the Actions, clic and create new Proxy Service and WSDL. Once the ProxyService is created, edit the message flow.

11. Add a route to the message flow and edit the route. Add Routing to that.



12. On the routing, select writeToFile BusinessService.
13. Click on Add an Action > Communication > Transport Headers


14. On this check "Pass all Headers through pipeline" and also click on Add Header.


15. Validate and Save All.
16. Commit the session and insert few rows in the database. You can see that every row will result in a file.
Right now we will write it to an XML file in /tmp with the name of the value as file name. We will have another exercise where we will map the XML file to a flat file using MFL.
Thanks for reading this.