• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB and JDBC

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Can I write the JDBC queries inside the business method of an Entity Bean or a Session Bean? Which Bean will be good for Writing JDBC queries?
Please let me know. I would appreciate If you could provide any link for the above.

Thanks.
Ganesh
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
You can write JDBC queries in both session as well as entity beans.However it depends on what you are trying to do with the queries.Session beans are used to represent a business process while entity beans represent an entity.If your JDBC queries span multiple entities you could use a session bean.With entity beans generally CMP is recomended, with the manipulation of data represented by them being done in the session bean.It is possible that with the use of EJB QL and entity beans you could achieve much of what you want without using JDBC queries

Hope this throws some light on your doubts.However whether to use JDBC queries or not, and whether to use them in session beans or entity beans is entirely a design decision

Regards,
Paresh Vernekar
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic