Is it possible to access two databases from two different venders i.e oracle,sybase from a single entity bean instance?Is it possible for both CMP & BMP ?If yes then how can we do that ?
It depends on what you meam. For CMP, you can generally control which database a particular EJB accesses through configuration. It is usually an easy matter to switch from one supported database to another.
If you mean an Entity Bean that can access two different databases at the same time, I don't know of any EJB vendors that support this for CMP. You can do it for BMP, but you would have to write the database management code yourself, and it would be very ugly.
I also have a hard time imagining a situation where this would be useful. Are you likely to have one system that accesses the exact same data in two different database at the same time. Odds are good that the data will be different, and it would be easier to write two separate Entities to manage the data. Even if the data was exactly the same, it would be unlikely to stay that way, and again two Entities would be better.
hi friend .,
For BMP the programmer must write the code to connect .. but for CMP possibly we cannot .
use cocobase :)
I'm looking into the same issue, here I want to develope one application source and descriptors which can connect t multiple database types, especially Oracle and MS SQL Server.
For example Oracle discourages the use of it' INTEGER, SMALLINT etc. types in favor of the NUMERIC with set scale and precision, these are all translated into java.lang.BigDecimal.