• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 691
  • Last Modified:

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.

  • 2
1 Solution
Amitkumar PSr. ConsultantCommented:
I understood, you are not dependent on any framework. So, you can go for hibernate rather than ejb.
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?
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now