• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Implement store procedure in EJB !!!!

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For last, I used to write store procedure, trigger in SQL Server 2000. And now I want to move store procedure code, trigger code and implement it into EJB technology. Can you help me how to do it ?. Thanks a lot.
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why not start with Suns EJB tutorial
 
Bill Dao
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I read Sun EJB Tutorial, but you know that you can create temporary table and you can use cursor in store procedure. For example with code of SP
CREATE TABLE #TempTable(
CustomerID int,
TotalMoney numeric)
INSERT INTO #TempTable
SELECT a.CustomerID, SUM(a.Total1) FROM table1 a
GROUP BY a.CustomerID
INSERT INTO #TempTable
SELECT b.CustomerID, SUM(b.Total2) FROM table1 b
GROUP BY b.CustomerID
UPDATE #TempTable SET TotalMoney=0 WHERE CustomerID<=0
SELECT CustomerID, TotalMoney FROM TempTable
GROUP BY CustomerID
I want to how to write similar code which can do it in EJB. Thanks for your attention.
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You would do this in Java, using Java objects to hold the intermediate values instead of a temporary table.
Kyle
 
Bill Dao
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reading. Can you show me detail of this problem ?. If you can't, can you help me to tel me the reference links which describes this problem ?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you could use stateless session beans or entity beans with BMP to wrap
your stored procedures
 
Bill Dao
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you give me the example code which implements what you tell me ?. Thanks for your attention.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe Bill is not looking to call the stored procedure from an EJB but rather get rid of the stored procedure and implement the same logic in Java...
 
A lot of people cry when they cut onions. The trick is not to form an emotional bond. This tiny ad told me:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic