• Post Reply Bookmark Topic Watch Topic
  • New Topic

I/O operation in EJB

 
Raj Jindal
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can we perform any I/O operation or file reading in some method of an EJB ban class.
Is it the right approach or some other good alternative is there
 
Viswanatha GB
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
NO, you should not use I/O,
Using the java.io package from within a bean is prohibited. The EJB 1.1 Specification, section 18.1.2 (Programming Restrictions) states the following:
An enterprise bean must not use the java.io package to attempt to access files and directories in the file system.
Solution is:
The file system APIs are not well-suited for business components to access data. Business components should use a resource manager API, such as JDBC API, to store data.
I hope this helps you..
Viswa
----------
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!