While your new book covers multiple ways for Java to access databases, I'm interested in your own thoughts about DB access with plain JDBC vs. Spring vs. Hibernate vs. JPA vs.??? Which approach do you prefer in your own work, and why? I'm partial to using plain JDBC for debugging purposes, even though it can take a lot more code. Thanks.
posted 1 year ago
I usually go with plain Hibernate, lately also with spring-data-jpa (backed by hibernate) and or a little bit of JooQ.
However I consider myself to be fairly fluent with Hibernate *and* SQL and am not afraid of writing plain SQL, where Hibernate has its restrictions.
It all depends on the size of your project though and it could very well be that plain JDBC is more than enough.