permaculture playing cards*
The moose likes EJB and other Java EE Technologies and the fly likes EJB and JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB and JDBC" Watch "EJB and JDBC" New topic
Author

EJB and JDBC

Sanjeev Shahi
Ranch Hand

Joined: Feb 26, 2001
Posts: 83
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

Joined: Jan 06, 2002
Posts: 150
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB and JDBC
 
Similar Threads
J2EE
call to procedure stops java application till procedure gets executed.
EJB intermittently does not respond, causing client EJB to timeout
What kind of objects we bound in JNDI ?
CMP and paging ?