Which is the best recommended solution for Data Access. I don't necessarily want to use EJBs, but has EJB3 evolved? Can EJB3 now substitute Hibernate? Our system is permission based system. In order to retrieve (say for eg, a list of investors), we first fire a query to see if the logged in user is fund admin or not, then retrieve the list of investors based on complex SQL Query mapping data from different tables and sometimes even using unions. We currently use Plain Old JDBC where opening and closing connections happen through an extended BaseDAO. I was wondering if
1. Because of our complex query structure, is there a simple ready made DAO object that we could extend and just pass on the actual parameterized SQL Query and that would automatically open and close connections and execute the results for us.
2. If not, has Ejb3 evolved and can it accommodate complex SQL Queries?
3. Is Hibernate better and provides more options than Ejb3
I am not too familiar with Hibernate and Ejb3 so please forgive the naiveness.