1

I have following requirement and need to know how can I implement the 2 phase commit using Spring JDBCtemplate.

  1. The Application (JAR) will run standalone as schedule JOB.(No Web Container)
  2. I need to connect 2 database. (Database 1 and Database 2)
  3. Connect Database 1 (Oracle) (select the DATA) and store in variable.
  4. Connect Database 2 (postgresql) (update/insert the DATA collected from the database 1 to database 2).
  5. If the transaction is successful for Database 2 then
  6. Connect The Database one and update the FLAG in the particular table.

Kindly suggest me with the sample working code or suggest alternate quick approach.

Regards, Mithil Shukla.

Mithil Shukla
  • 113
  • 3
  • 8

0 Answers0