dcsimg
Inserting a row simulataneously in two databases.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   venkatesh_thiagarajan
Posted On:   Friday, May 28, 2004 10:03 PM

I have the same table in two different databases. Say for example Oracle and SQL Server. The table name is Customer. I wanted to insert a row in both the databases simultaneously. How can I do it?

Re: Inserting a row simulataneously in two databases.

Posted By:   Sean_Owen  
Posted On:   Friday, May 28, 2004 11:09 PM

You do just that -- insert into one database by obtaining a JDBC Connection, doing the insert, and then insert into the other in the same way. There is nothing special here.



If you want to do both inserts in one transaction, it is more complicated. You need XA-aware database drivers, and may need to use JTA to manage the transaction across both databases as well. Start searching for those topics on the internet.

About | Sitemap | Contact