The better way to work with a SQL databaseĀ and a programming language like java is by using a ORM (Object-Relational Mapping) layer such as hibernate or JPA.
An ORM layer basically provides an object oriented interface to a relational database. That means that instead of writing a query to insert or update a record, you assign some properties [...]