on 10-29-2007 5:51 AM
Hi Experts,
I want to access a oracle database using jdbc connectors.
I want to fire a select query using the EJBs.
Can you help me in deciding how do i access these oracle tables .. using which bean?
Entity bean or session bean?
can anybody give me some examples on this?
Thanks in advance.
Regards,
Ashish Shah
Hi Ashish
One stateless bean with four methods is better.
Regards
Pratyush
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ashish
Basically entity beans model business concepts that can be expressed as nouns. For example, an entity bean might represent a customer, a piece of equipment, an item in inventory. Thus entity beans model real-world objects. These objects are usually persistent records in some kind of database.
Session beans are for managing processes or tasks. A session bean is mainly for coordinating particular kinds of activities. That is, session beans are plain remote objects meant for abstracting business logic. The activity that a session bean represents is fundamentally transient. A session bean does not represent anything in a database, but it can access the database.
Thus an entity bean has persistent state whereas a session bean models interactions but does not have persistent state.
Session beans are transaction-aware. In a distributed component environment, managing transactions across several components mandates distributed transaction processing. The EJB architecture allows the container to manage transactions declaratively. This mechanism lets a bean developer to specify transactions across bean methods. Session beans are client-specific. That is, session bean instances on the server side are specific to the client that created them on the client side. This eliminates the need for the developer to deal with multiple threading and concurrency.
Unlike session beans, entity beans have a client-independent identity. This is because an entity bean encapsulates persistent data. The EJB architecture lets a developer to register a primary key class to encapsulate the minimal set of attributes required to represent the identity of an entity bean. Clients can use these primary key objects to accomplish the database operations, such as create, locate, or delete entity beans. Since entity beans represent persistent state, entity beans can be shared across different clients. Similar to session beans, entity beans are also transactional, except for the fact that bean instances are not allowed to programmatically control transactions.
Hope it helps
Regards
Pratyush
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ashish,
U can find the examples & tutorials here
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#20">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#20</a>
u can check this Using EJBs in Web Dynpro in Backend Access/ Model section.
regards
Sumit
Hi ,
Check the following link
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b00917dc-ead4-2910-3ebb-b0a63e49ef10">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b00917dc-ead4-2910-3ebb-b0a63e49ef10</a>
Regards,
Abdullah
Hi,
Consider this scenario : I have to access four different database tables for four different purpose.
How should i access the database,
1) Should i create 4 different stateless session beans and write the methods in each of this Session beans.
2) Should i create 1 Stateless session beans and add 4 methods in this one stateless session bean?
Regards,
Ashish Shah
you need to refer some design patterns:
http://java.sun.com/blueprints/corej2eepatterns/Patterns/index.html
Message was edited by:
Armin Reichert
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.