hi,
I am using stateless session beans. My servlet is going to call the stateless session bean and then that bean is going to call the database to get/update the database.
Is it better to have a bean for doing all database operations or to have a class for doing it ???
servlet - > accountEJB - > databaseEJB - > database
or
servlet - > accountEJB - > database Object(this will be a simple class ) - > database
which one is better ??
TIA
Anil
-
data access bean or data acccess object ?? (3 messages)
- Posted by: anil bisht
- Posted on: March 05 2002 10:49 EST
Threaded Messages (3)
- data access bean or data acccess object ?? by Neeraj Nargund on March 05 2002 14:18 EST
- data access bean or data acccess object ?? by Pankaj Vij on March 05 2002 14:30 EST
- data access bean or data acccess object ?? by anil bisht on March 06 2002 12:10 EST
- data access bean or data acccess object ?? by Pankaj Vij on March 05 2002 14:30 EST
-
data access bean or data acccess object ??[ Go to top ]
- Posted by: Neeraj Nargund
- Posted on: March 05 2002 14:18 EST
- in response to anil bisht
ervlet - > accountEJB - >DAOAcess - > database
DAOAcess will contain all your SQL Queries. -
data access bean or data acccess object ??[ Go to top ]
- Posted by: Pankaj Vij
- Posted on: March 05 2002 14:30 EST
- in response to Neeraj Nargund
Hi Guys
Why to use DAOs here ?
I cant seem to understand why not CMP/BMP ?
I have posted a similar question as to where should DAOs be used.Most of the DAOs I have seen in action are single table type objects.
If I do JDBC queries in a DAO ; I need to do my own transaction management.So I can safely say that for
Create/Update/Delete ; I would like to go for CMP/BMP.
For select (which are normally multiple table joins) why not to embedd queries in the session beans cause CMP/BMP finds are expensive ; and I cant again think why would I use DAOs here?
Thanks
Tim -
data access bean or data acccess object ??[ Go to top ]
- Posted by: anil bisht
- Posted on: March 06 2002 00:10 EST
- in response to Pankaj Vij
ok to be more clear .
We are using stored procedures.
So in my data_access_object/data_acccess_bean
i am going to pass the stored procedure name and the input parameters. and getting the collection(in my dao i am converting the resultset to a collection)
So whenever my stateless session bean talks to database it takes through my DAO.
So i am bit confused as to use a data access object or to use a bean for that..
TIA
Anil