[Logo]
Forums Register Login
The Life without EJB
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 .
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.

 
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?
OK.

did you try hibernate ??
JPA seems an obvious candidate.
 
R K Singh wrote:OK.

did you try hibernate ??


It requires an EJB container, right?
 
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?
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
Many thanks for Cameron.
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Oct 18, 2017 18:08:32.