Java and Databases: A Practical Guide
300 pages
English
PDF
4.5

Java and Databases: A Practical Guide

Java and Databases: A Practical Guide

Author:

Year:

Summary:

The book "Java and Databases: A Practical Guide" is a comprehensive resource for developers who want to master working with databases in the Java ecosystem. The author, experienced software architect Alexey Kuznetsov, systematically guides the reader from the basics of SQL and JDBC to advanced techniques with Hibernate, Spring Data JPA, and NoSQL solutions.



The book is structured on the "from simple to complex" principle and contains many real-world code examples ready for use in projects. You will learn how to design data schemas, write efficient queries, manage transactions, and optimize performance.



What you will learn from this book:

  • Fundamentals of relational databases and SQL (JOIN, subqueries, indexes)
  • Working with JDBC: connection, PreparedStatement, connection pools (HikariCP)
  • ORM frameworks: Hibernate (mapping, caching, lazy loading)
  • Spring Data JPA: repositories, QueryDSL, specifications
  • Transactions: ACID, isolation levels, distributed transactions (JTA)
  • NoSQL: MongoDB, Redis, Cassandra — when and how to use them
  • Database migrations with Flyway and Liquibase
  • Testing the DAO layer with Testcontainers and H2
  • Profiling and query optimization (explain, slow query log)


Who this book is for:

  • Beginner and intermediate Java developers looking to deepen their knowledge of working with databases
  • Backend engineers transitioning from other languages to Java
  • IT students and graduates studying enterprise development
  • Tech leads wanting to systematize knowledge of modern data storage approaches


Each chapter contains practical exercises and self-assessment questions. At the end of the book, you will find a complete project — a web application for order management, where all the described technologies are used together. The code is available on GitHub.



The book is written in a lively, clear language without excessive academic style. All examples are tested on Java 17+ and current versions of libraries (Hibernate 6.x, Spring Boot 3.x, MongoDB 7.x).



Even if you already work with databases in Java, this book will help fill in the gaps, learn new patterns, and look at familiar technologies from a different angle. Special attention is paid to performance and security issues — topics that are often overlooked in other guides.



Recommended as a desktop reference for every Java developer working with data.

Recommendations