• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cross-database and cross-schema portability

 
Kingsly Theodar
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which object can be used to increase cross-database and cross-schema portability?
A. entity bean
B. home object
C. session bean
D. data-access object

The answer which I gave was "A. entity bean" but the correct answer as given by Sun is "Data-access object".

Could anyone explain why?

Thanks in Advance

Note:
This is a sample question given by Sun, which could be found at
http://stephane.weber1.free.fr/SCEA/Java/certification_archj2ee_07_01.pdf
 
Saha Kumar
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Kingsly,

To me DAO is correct because you could use a DAO factory to supply a DAO for different databases (Oracle, Sybase, etc.) as need be.

-Saha
 
Kingsly Theodar
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Saha.

But is it not that, even CMP (Entity Beans) also takes care of doing the same?
 
Thomas Taeger
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kingsly Thewdar:
Which object can be used to increase cross-database and cross-schema portability?
...
... the correct answer as given by Sun is "Data-access object".

I suppose Sun (or the specific author) is wrong here. In a DAO you must rely on the vendor specific SQL dialect. MS-SQL Server dialect will not be understood by Oracle and vice versa.

So the right answer realy might be Entity EJB - with standardized EJB QL instead of theoretically standardized but violated SQL.

Session EJBs can not help in this point because
1. they should not access the data tier directly and
2. even if they would their SQL statements would need to be as vendor specific as those of DAOs.

Thomas
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic