Requirement : Read contents of a text file and upload the same to Oracle database (table).
I have created a Java class (application kind of) which opens, reads a file and transfers its data to a Oracle table.
Can I instantiate the same class within a Session Bean to perform the same operation or as per the EJB Restrictions this is not supposed to be done?
EJB Specifications 2.1 pdf guide (refer 25.1.2 Programming restrictions An enterprise bean must not use the java.io package to attempt to access files and directories in the file system. 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, to store data. )
Thks for ur post. I am using Log4J but my query was that I want to read a file (txt file) and insert its contents in a oracle table.
I have one file called FileIO.class which does the same. Question is If I instantiate this class in a business method of Stateless Session Bean and call the appropriate method of uploading the file contents in a oracle table, will it create any issues?