Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB and JDBC

 
Sanjeev Shahi
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am little confused, can anyone tell me where in ejb I'll write all the stuff related with JDBC like JDBC connection, preparedstatements etc.
thanks,
ss
 
Ruilin Yang
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In BMP entity beans, you need JBBC (SQL) code in the ejbCreate, ejbLoad, ejbStore, ejbRemove, ejbFind... methods (you may have more). Create an ejb means you insert a record into a database. Remove an Entity bean neans delete a record in a database.
In CMP entity bean you need do some code in the deployment descriptor (declairitively).
When using a session bean to connect to a database, you either put jdbc code in the bean's business methods or use a DAO to put JDBC code in the DAO.
Hope this will help
Regards,
Ruilin
[ February 07, 2002: Message edited by: Rulin Yang ]
[ February 07, 2002: Message edited by: Rulin Yang ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic