wood burning stoves 2.0*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes JPA question X  CMP and JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "JPA question X  CMP and JDBC" Watch "JPA question X  CMP and JDBC" New topic
Author

JPA question X CMP and JDBC

Steven Colley
Ranch Hand

Joined: Feb 18, 2005
Posts: 290
Hello folks, i have a question regarding this scenario :

- All data is stored in a relational database system
- multiple applications access this data using a single persistence layer.
- The model includes complex relationships between tables.
- Design requirements will include supporting complex queries, bulk updates/deletes, and disconnected operations

1) JPA
2) CMP
3) BMP
4) JDBC

Question : The answer is JPA because simply CMP and JDBC don't accept neither "bulk and disconnected operations"?

And what about to regard the term "complex queries"? Isn't JPA only used for simple queries?

tks in advance!! ;-)


SCJP | SCWCD | SCBCD | SCWSD 5 | SCEA (I) 1.4 | SCEA 5 | IBM SOA 669
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

I think JPA can be used for both simple and complex queries, although it does depend on how complex 'complex' is. You can usually get JPA to do what you want it to do, although sometimes just straight SQL may be easier than doing it through JPA - as could be said for pretty much any persistence mechanism built upon JDBC.

As far as bulk updates go, well, I'd use a bulk updating mechanism at the database level. Why involve Java processing when it's a bulk process? That's what ETL tools are for. If you have a license for Datastage hanging around then you should use it.

-Cameron McKenzie
Steven Colley
Ranch Hand

Joined: Feb 18, 2005
Posts: 290
OK, tks Cameron !! ;-)
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

The answer is JPA because simply CMP and JDBC don't accept neither "bulk and disconnected operations"?


Remember that JPA will be implemented, under the covers, through JDBC. So in the end, everything is limited by the capabilities of JDBC.

-Cameron McKenzie
Steven Colley
Ranch Hand

Joined: Feb 18, 2005
Posts: 290
Right..I see....the issue is how to figure out whether the exam/question is talking about JDBC or JPA....you see...probably I'll be getting a question like this : "complex queries..."....

tkkks so much Cameron!! ;-)
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

One thing you are very right about is "figuring out what the exam questions is asking."

You could post just about any SCEA exam question on JavaRanch and start a firestorm debate about which answers is 'most correct.' But on the exam, it's not up for debate. Knowing the correct answer is just as important as knowing the correct answer that they want.

-Cameron McKenzie
[ May 06, 2008: Message edited by: Cameron Wallace McKenzie ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JPA question X CMP and JDBC