Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The Life without EJB

 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK.

did you try hibernate ??
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JPA seems an obvious candidate.
 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
R K Singh wrote:OK.

did you try hibernate ??


It requires an EJB container, right?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many thanks for Cameron.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic