EJB seems to be one of many approaches you can take. Options to take are
JDBC and Data Access Objects, JDO (
Java Data Objects), object-relation mapping tools like Hibernate and Toplink. There are arguments for and against all of these, and it would probably depend on the project using them. Lately EJB have been getting some bad press due to project which have used EJB and made mistakes with them, not understanding their limitations. One aspect that can cause problems is the use of EJB QL and container manager relationships. EJB QL is still very limited compared to SQL, and bulk operations are probably best done using SQL.