how to connect session bean to database and run it on J2EE

Hi guys,
I was trying to connect session bean to database but was confused as to where to write the code for database connection(which method) ?? Also how do i configure my J2EE settings to deploy this bean ??

Is session bean best to connect to database or entity bean (if i do not care about persistence).

Also how is the following flow done --
servlet calling--session bean ---calling entity bean .

Any sample code will be of great help.

thank you so much.

Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

mbormannConnect With a Mentor Commented:
Please click around this site,this is one of the best around.
This site is very rich and contains lots of code along with simple explanations with detailed diagrams.

So anybody wanting to learn fast abt EJB's would get up to speed very quickly.

With Best Regards
All Courses

From novice to tech pro — start learning today.