*
The moose likes EJB and other Java EE Technologies and the fly likes EJBs vs Stored Procedures vs Plain JDBC 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 "EJBs vs Stored Procedures vs Plain JDBC" Watch "EJBs vs Stored Procedures vs Plain JDBC" New topic
Author

EJBs vs Stored Procedures vs Plain JDBC

Karim Nasser
Greenhorn

Joined: Sep 04, 2002
Posts: 11
Hi I belive this issue had be raised several times, the use of EJBS has been questioned alot later, the question is when to use EJBs? and what are the benefits you get over using other solutions (stored procedures, JDBC ...), and what will ou lose if you if you went for other solutions?!!
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
"knasser",
Your display name does not comply with our naming policy. You can change it here.
Thanks.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Regarding your question, that is a FAQ. Search this forum or take a look at these threads for example:
http://www.coderanch.com/t/311236/EJB-JEE/java/When-EnterpriseBeans
http://www.coderanch.com/t/312178/EJB-JEE/java/usage-ejb
Karim Nasser
Greenhorn

Joined: Sep 04, 2002
Posts: 11
unfortunately none of these links answered the question or even discussed it thoroughly!!
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
I think you are confusing EJB with Enity Beans. There is nothing stopping anyone from using EJB + JDBC or Stored Procedures. Furthermore, you could even utilize plain JDBC or Stored Procedures from BMP. So it is not a simple either or question. However, I do routinely point out that EJB is massively inappropriate for most projects, especially simple web applications.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Kareem, you're correct about the links not answering your question. I stopped at "when to use EJBs" and the FAQ flag was up... Sorry about that.
However, the suggestion to do a search on the forum was/is valid. This time, having read the latter part of your post, I'll try to pick a little more appropriate links for you:
http://www.coderanch.com/t/310036/EJB-JEE/java/Entity-Beans-Vs-JDBC
http://www.coderanch.com/t/310252/EJB-JEE/java/EJB-vs-JDBC
http://www.coderanch.com/t/311894/EJB-JEE/java/Entity-Beans-REALLY-only-Low
http://www.coderanch.com/t/312191/EJB-JEE/java/JDBC-Reading-Vs-EJB
Karim Nasser
Greenhorn

Joined: Sep 04, 2002
Posts: 11
Chris, you didnt get my point, what I am talking about is the advantage of using Entiy beans over SP, when we talk about EJB we usually mention "Transactions" ,"security" and "Disributed preocessing".
"transactions" : can be achieved in SP with the same simplicity as container managed transactions ...so it is not a big advantage
"security" : J2EE only offers class based security which is not suitable for most enterprise applications
"distributed proccessing" : looks like the main advantage of using entity beans over stored procedure , but you can alos wrap the stored procedure in a Session bean and you get it.
The OO programmer inside me likes the EJBs but how can you convince a customer to pay for such "time consuming" & "exprience requiring= money" EJBs??
Kareem N.Elsayed
SCEA part-I, SCWCD, SCJP2
[ September 11, 2003: Message edited by: Kareem Nasser ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJBs vs Stored Procedures vs Plain JDBC