Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

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: 8944
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...
 
All that thinking. Doesn't it hurt? What do you think about this tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic