• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using EJB and Oracle

 
Oleg Shklyar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ranchers,
Will anybody clarify my questions:
1. I am using WebLogic 6.0 and Oracle 8.1.7. A primary key generated using sequence object in RDBMS. Following Ed Roman book "Mastering EJB" I created CMP enterprise bean and in weblogic-cmp-rdbms-jar.xml descriptor I used weblogic QL.
Why I can not get the recordset using findAll() method containing all DB fields without using create() method ? I tryed to create() first and findAll() next and it works, but I don't need to create any row, I just need to select it.
2. How should I use sequence object with connection to EJB. There is no proper explanation in EJB books
TIA
Oleg
 
faisal mahmood
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure if this is possible with CMP.
you can use bean-managed entity beans for your purpose.
Faisal
 
Oleg Shklyar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Faisal.
I'd like just to clarify the second thing: when I'm doing with Oracle I have to use sequence object to get a value to have it as primary key (for MS SQL Servet you don't need to deal with primary key at all if it is assigned with IDENTITY).
If someone doing with Oracle, please tell me: should I get the value of primary key first (calling the sequence object first) and then pass that value into CallableStatement object's methods.
Please give your suggestions.
TIA
Oleg
 
Marcos Maia
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created CMP enterprise bean and in weblogic-cmp-rdbms-jar.xml descriptor I used weblogic QL.
Why I can not get the recordset using findAll() method containing all DB fields without using create() method ? I tryed to create() first and findAll() next and it works, but I don't need to create any row, I just need to select it.
2. How should I use sequence object with connection to EJB. There is no proper explanation in EJB books

Hi I think the design patterns catalog from sun it�s gonna beat very usefull to clarify your questions, take a look at: http://java.sun.com/j2ee/blueprints/design_patterns/index.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic