What is the simplest way to use database persistence in Java? I know, many frameworks exists around the Internet, but it could be fun to learn how to develop a persistence layer by myself and its design patterns. Where to start? Books, websites, how-tos, code-examples, etc.
Start by looking at features and source code of pre-existing ones. Here are a couple (just to name a few in alphabetical order)
And soon, you can edit this answer and add your own framework!
it could be fun to learn how to develop a persistence layer by myself
Noooo! Don't be silly.
Use JDO or JPA. The first one is a generic object persistence API, the other one is aimed at RDBMS-es only.
They have various implementations, e.g. for JPA there is EclipseLink (formerly Oracle TopLink), which is also the reference implementation for JPA 2, and Hibernate, which is also very popular.
You really, really don't want to make your own. If you want to work in this area, then contribute to one of the existing projects instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With