This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes The Life without EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "The Life without EJB" Watch "The Life without EJB" New topic
Author

The Life without EJB

Treimin Clark
Ranch Hand

Joined: Nov 12, 2008
Posts: 757
If the web host of your company do have a servlet container like Tomcat, but do not have an EJB container, what can you do with your web application in order to communicate with the database? I know you can use JDBC codes to directly communicate with the database. But isn't their any other API (or something else) so that we can use it to communicate with the database easily, in the given Tomcat environment? Isn't their something like a "Portable EJB Api" so that we can use it without having an EJB container?

PS- I think Ulf may know an answer .
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Why do you need EJBs to talk to a database? There are plenty of DAO and ORM frameworks out there that will do this work for you.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Treimin Clark
Ranch Hand

Joined: Nov 12, 2008
Posts: 757
Paul Sturrock wrote:Why do you need EJBs to talk to a database? There are plenty of DAO and ORM frameworks out there that will do this work for you.



But it is not easy like EJB persistence. Can we access the database through something like entities?
R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5371
OK.

did you try hibernate ??


"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41064
    
  43
JPA seems an obvious candidate.


Ping & DNS - my free Android networking tools app
Treimin Clark
Ranch Hand

Joined: Nov 12, 2008
Posts: 757
R K Singh wrote:OK.

did you try hibernate ??


It requires an EJB container, right?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41064
    
  43
It requires an EJB container, right?

With all due respect, are you doing any research on your questions? Which part of the Hibernate documentation made you believe it requires EJB?
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Hibernate is just POJO based, and runs without any container, EJB or even web. Just a main method is all you need to use Hibernate and persist your objects against a database. JPA is a big part of EJB3, and Hibernate can use JPA annotations, but that doesn't bind it to an EJB container by any means.

Check out my signature links for some simple Hibernate examples and tutorials.

-Cameron McKenzie
Treimin Clark
Ranch Hand

Joined: Nov 12, 2008
Posts: 757
Many thanks for Cameron.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The Life without EJB
 
Similar Threads
Webserver Vs Application Server
Light-weight EJB 3 container
J2EE and Tomcat
What is JBoss?
What is the role of Web Servers?