File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes using 2 databases Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "using 2 databases" Watch "using 2 databases" New topic
Author

using 2 databases

Renata fonseca
Ranch Hand

Joined: Mar 15, 2002
Posts: 48
Hi all
I have to update 2 databases at same time... how can I persist an entity bean into two different databases (ie: Db2 and SQL Server)?
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Some options:
1) Use a BMP entity bean
2) Use your EJB container's proprietary features (not likely to exist)
3) Use a special JDBC driver, which can do the update on two databases (don't know if such drivers exist)


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
How about use two different beans?
Kyle


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: using 2 databases
 
Similar Threads
Correct approach ? Stored Proc (returning cursor) Vs Prepared statment
Doubt about type 2 driver
Configuring multiple database in JPA?
do we need 2 database files one rmi one local???
Type 2 driver