• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

ejbCreate()

 
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had a question about ejbCreate(). The book,"Mastering EJB" by Ed Roman on Table 4.1 says that for a stateless session bean "You can define only have a single ejbCreate method with no parameters"
Say If I have a stateless session bean for a credit card validation. All it does is returns a yes or a no for a validitiy of a credit card. I was thiking that this could be done by sending the credit card number, expiry date adn the name as parameters to the bean and having it return a yes or a no.
Can somebody help me clear my confusion?
PK
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Prakash,
You can do this by sending the credit card information to the business methods in you bean. The create method creates the bean instance and returns a reference, which you can use to call business methods.
So I could have a method public boolean validate(cc number, exp date..), etc which does the job for you. This would be declared in the remote interface and implemented in the bean class.
Does that help ?
-Sri
 
Prakash Krishnamurthy
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Sri Basavanahally:

Does that help ?
-Sri


Sri,
THat does help. I was thinking that the stuff on the book could have been a mis-print. But now I am convinced..
 
Did you ever grow anything in the garden of your mind? - Fred Rogers. Tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic