Java Database Connectivity Options

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.

Ashwin
AshwinAdvaniAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Amitkumar PSr. ConsultantCommented:
I understood, you are not dependent on any framework. So, you can go for hibernate rather than ejb.
0
AshwinAdvaniAuthor Commented:
The complexity is that our queries are permission based; There are a lot of inner joins; outer joins and union clauses. I believe Hibernate needs to define primary keys in the DTOs and has object relational mapping to other objects which might get complicated in the future. I am thinking of using Apache DBUtils class. Are there any issues sticking to plain old JDBC and having a finer control on the SQL queries?
0
Amitkumar PSr. ConsultantCommented:
I haven't work with Apache DBUtils, so can't comment on it. Sorry.

Regarding plain old JDBC to get finer control, you can go ahead. Working with core APIs (rather than framework) always provides more control to achieve the objective.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.