File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Advantages of EJB compare to JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Advantages of EJB compare to JDBC" Watch "Advantages of EJB compare to JDBC" New topic

Advantages of EJB compare to JDBC

rakesh kumar nampally
Ranch Hand

Joined: Feb 03, 2007
Posts: 46
Hi All,

What is advantage of using EJBs compare to using JDBC directly keeping Transaction Part aside.
Harinath Kuntamukkala
Ranch Hand

Joined: May 17, 2005
Posts: 37
Business logic is in a re-usable component on the server, so you can easily re-use it in other webapps, or in other client types (e.g. PDA, Swing client)
Martijn Verburg

Joined: Jun 24, 2003
Posts: 3275

Some people also prefer not having to deal with SQL directly, I personally find that a fairly weak reason but YMMV


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32844

Since you are comparing to JDBC, you would mean entity beans (EJB 2.1) or JPA (EJB 3.0). Both are intended to be mapping frameworks to insulate you from the database. JPA/EJB 3 does a much better job at that.

Personally, I don't like the idea of putting business logic in an entity bean. There's too much EJB specific stuff in there to be easy to deal with. This situation improves in JPA.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Advantages of EJB compare to JDBC
It's not a secret anymore!