Skip to content
Tutorials Center
My learning

Topics

Advanced Java Tutorial

Go beyond core Java: JDBC, JSON, JUnit testing, HTTP and REST APIs, Servlets and JSP, JPA and Hibernate, Spring, Spring Boot, Spring Cloud, microservices and Docker. 119 lessons with live examples.

Start learning →

of lessons completed

Getting Started

  1. 1 Advanced Java: Introduction Start the Advanced Java course. See the backend ecosystem map (JDBC, JSON, testing, REST, JPA, Spring Boot) and run real database, HTTP and JUnit code.
  2. 2 Setting Up a Java Development Environment Set up a professional Java workstation - choose a JDK distribution, set JAVA_HOME, pick an IDE, learn the standard project layout and run databases in Docker.
  3. 3 Maven in Depth Learn Maven properly - pom.xml anatomy, coordinates, dependency scopes, transitive dependencies and conflicts, the build lifecycle, plugins, profiles and modules.
  4. 4 Gradle in Depth Learn Gradle for Java - build.gradle.kts, plugins, implementation vs api and other configurations, version catalogs, tasks, incremental builds, the wrapper and Maven vs Gradle.

Databases with JDBC

  1. 5 SQL Refresher for Java Developers Refresh the SQL every Java developer needs - CREATE TABLE, INSERT, SELECT, UPDATE, DELETE, keys, constraints and joins - run live from Java against an H2 database.
  2. 6 JDBC Introduction Learn how JDBC connects Java to databases - the API and driver architecture, connection URLs for H2, MySQL and PostgreSQL, try-with-resources and DatabaseMetaData.
  3. 7 CRUD with JDBC Insert, query, update and delete rows with JDBC - Statement vs PreparedStatement, executeUpdate and executeQuery, ResultSet getters, NULLs, generated keys and records.
  4. 8 PreparedStatement and SQL Injection Break into a login built with string concatenation, see why PreparedStatement parameters stop SQL injection, and handle LIKE, IN lists and ORDER BY safely in JDBC.
  5. 9 Transactions with JDBC Learn JDBC transactions in Java - autocommit, commit and rollback, a money transfer that fails safely, savepoints, isolation levels and the anomalies they prevent.
  6. 10 Statements, Stored Procedures and ResultSet Types Compare Statement, PreparedStatement and CallableStatement, call stored procedures with IN and OUT parameters, and use scrollable ResultSets and RowSets.
  7. 11 Batch Updates, Metadata and Large Objects Speed up JDBC inserts with addBatch and executeBatch, print any query with ResultSetMetaData, store text and files as CLOB and BLOB, and scroll result sets.
  8. 12 Connection Pooling and DataSource Learn why Java apps pool database connections, how the DataSource interface works, how to configure HikariCP, size a pool, and find connection leaks.
  9. 13 The DAO and Repository Patterns Separate persistence from business logic in Java. Build a JDBC BookDao over H2, add a row-mapping helper, swap in a fake for tests, and share transactions.

Data Formats

  1. 14 JSON with Jackson Convert Java objects to JSON and back with Jackson's ObjectMapper - records, POJOs, lists and maps, TypeReference, pretty printing, java.time dates and errors.
  2. 15 Advanced Jackson Master Jackson annotations (@JsonProperty, @JsonIgnore, @JsonInclude, @JsonFormat), the JsonNode tree model, unknown fields, polymorphic types and custom serializers.
  3. 16 XML Processing Parse XML in Java with DOM and XPath, stream big files with StAX, write XML with Transformer, and lock down parsers against XXE attacks. JAXB notes included.
  4. 17 CSV, Properties and Other Formats Read and write CSV in Java without the classic bugs, handle quotes, commas and newlines, master Properties files, meet YAML and binary formats, and pick the right one.

Testing

  1. 18 Unit Testing with JUnit 6 Learn JUnit 6 step by step. Write @Test methods, use assertEquals, assertThrows and assertAll, name tests clearly and read pass and fail reports.
  2. 19 Test Lifecycle and Organization Control the JUnit 6 test lifecycle with @BeforeEach and @BeforeAll, group tests with @Nested and @DisplayName, and skip or filter them with @Disabled, @Tag and assumptions.
  3. 20 Parameterized Tests Run one JUnit test against many inputs with @ParameterizedTest, @ValueSource, @CsvSource, @MethodSource and @EnumSource, plus @RepeatedTest and dynamic tests.
  4. 21 Test Doubles and Mockito Learn the five kinds of test doubles with runnable examples, build a tiny mock library to see how Mockito works, then use when, verify and ArgumentCaptor well.
  5. 22 Test-Driven Development Learn test-driven development in Java by building a ticket pricer test-first with JUnit, step by step through red, green and refactor, plus TDD's real benefits and limits.
  6. 23 Integration Testing Write Java integration tests that hit a real database and HTTP server, keep test data isolated, use Testcontainers and Failsafe, and read JaCoCo code coverage wisely.
  7. 24 Integration Tests with Testcontainers Run integration tests against real PostgreSQL, Redis or Kafka in throwaway Docker containers, covering lifecycle, wait strategies, Spring Boot ServiceConnection, speed and CI tips.
  8. 25 Load Testing Java Services Learn load testing for Java services - throughput, latency percentiles, open and closed workloads, JMeter and Gatling basics, and how to find the real bottleneck.

Logging and Tooling

  1. 26 Logging with SLF4J and Logback Log like a professional Java developer. Learn java.util.logging, the SLF4J API, Logback and Log4j 2 configuration, log levels, placeholders, MDC and JSON logs.
  2. 27 Debugging and Profiling Tools Debug and profile Java apps like a pro. Use IDE breakpoints, remote debugging, jcmd, jstack and jmap, thread and heap dumps, Java Flight Recorder and Mission Control.
  3. 28 Code Quality and Static Analysis Keep Java code clean and correct with formatters, Checkstyle, SpotBugs, PMD, Error Prone and SonarQube, plus build setup and code review habits that work.

Web Fundamentals

  1. 29 How HTTP Works Understand HTTP from the wire up - requests, responses, methods, status codes, headers, bodies and cookies - with a real Java server and client in one program.
  2. 30 Calling APIs with HttpClient Call REST APIs from Java with java.net.http.HttpClient - GET, POST, PUT and DELETE with JSON via Jackson, headers, timeouts, async calls, errors and retries.
  3. 31 Building a REST API with the JDK Build a JSON CRUD REST API in plain Java - HttpServer, Jackson, an in-memory store, routing by method and path, status codes, validation and JUnit tests.
  4. 32 REST API Design Design REST APIs people enjoy using - resource URLs, methods, status codes, pagination, filtering, versioning, idempotency, ETags, problem details and OpenAPI.
  5. 33 Web Security Basics Learn web security essentials in Java - authentication vs authorization, sessions and tokens, PBKDF2 password hashing, HTTPS, XSS, CORS, CSRF and the OWASP Top 10.

Servlets and JSP

  1. 34 Jakarta EE Overview Understand Jakarta EE - the move from Java EE and javax to jakarta, the main specifications, profiles, servers like Tomcat and WildFly, WAR files and how Spring fits in.
  2. 35 Servlets Learn Jakarta Servlets - HttpServlet, doGet and doPost, @WebServlet mappings, request and response objects, HTML and JSON output, and the threading rules.
  3. 36 Handling Requests, Forms and Redirects Read servlet request parameters and forms, pass data with request attributes, choose forward or redirect, send the right status codes and handle file uploads safely.
  4. 37 Sessions and Cookies Learn how servlets remember users with HttpSession and cookies, set HttpOnly, Secure and SameSite correctly, prevent session fixation and log users out safely.
  5. 38 Filters and Listeners Learn servlet filters and listeners - write logging and auth filters, understand the filter chain and its order, wrap requests and responses, and react to app and session events.
  6. 39 Servlet Lifecycle and Deployment Learn the servlet lifecycle (init, service, destroy), why one servlet instance serves many threads, web.xml vs annotations, WAR files, Tomcat deployment and embedded servers.
  7. 40 JavaServer Pages (JSP) Learn JavaServer Pages - directives, scriptlets and why to avoid them, implicit objects, includes, and how a JSP is translated and compiled into a servlet.
  8. 41 JSTL and Expression Language Write JSP views without Java code using Expression Language and JSTL - scopes, c:if, c:forEach, c:out escaping, fmt formatting, servlet + JSP MVC and modern template engines.
  9. 42 JAX-RS: RESTful Services with Jakarta REST Build REST services with JAX-RS (Jakarta REST) - @Path resources, parameter injection, content negotiation, ExceptionMapper, filters, the client API and how it compares with Spring MVC.
  10. 43 CDI and Enterprise JavaBeans Learn Jakarta CDI and EJB - dependency injection scopes, qualifiers, producers, interceptors, session beans, container-managed transactions and rollback rules, and how Spring compares.
  11. 44 JavaServer Faces (JSF) Basics Learn Jakarta Faces (JSF) - Facelets pages, CDI managed beans, expression language, the component tree, the six lifecycle phases, validation, converters and navigation, with runnable models.
  12. 45 SOAP Web Services and JAX-WS Understand SOAP web services in Java - the envelope, WSDL contract, Faults, JAX-WS server and client code, contract-first versus code-first, and when SOAP beats REST.
  13. 46 Servlet CRUD Web App with Pagination and File Download Build a complete list, add, edit and delete web app with servlets, a JDBC DAO, paged lists and a CSV download using Content-Disposition, with runnable HttpServer and H2 versions.
  14. 47 Apache Struts Overview Understand Apache Struts, the first popular Java MVC framework - Action classes, ActionForm, struts-config.xml, the request flow, Struts 2 interceptors and why Spring MVC replaced it.

JPA and Hibernate

  1. 48 ORM and JPA Introduction Understand object-relational mapping - the object-relational mismatch, what an ORM does for you, JPA vs Hibernate, EntityManager basics and when plain JDBC is the better choice.
  2. 49 Entities and Hibernate Setup Set up Hibernate with persistence.xml, then map JPA entities with @Entity, @Id, @GeneratedValue, @Table and @Column, choose ID strategies and avoid common mapping mistakes.
  3. 50 Entity Relationships Map JPA relationships the right way - @ManyToOne, @OneToMany, @OneToOne and @ManyToMany, the owning side, mappedBy, cascades and orphanRemoval, with real SQL tables.
  4. 51 Querying with JPQL and the Criteria API Query JPA entities with JPQL and the Criteria API - parameters, joins, named queries, DTO projections, pagination, bulk updates and native SQL, with runnable SQL on H2.
  5. 52 Inheritance Mapping and Embeddables Map Java class hierarchies with JPA - @MappedSuperclass, SINGLE_TABLE, JOINED and TABLE_PER_CLASS with their SQL - plus @Embeddable value objects and element collections.
  6. 53 Fetching Strategies and the N+1 Problem Make JPA fast - lazy vs eager loading, the N+1 query problem measured on H2, join fetch, entity graphs, batch fetching, and first- and second-level caching.
  7. 54 Entity Lifecycle and Transactions Understand JPA entity states, persist vs merge, dirty checking and flush, how @Transactional commits and rolls back, and optimistic locking with @Version.
  8. 55 Hibernate's Native API: Session, HQL and Native SQL Use Hibernate's native API - Session vs EntityManager, configuration styles, HQL beyond JPQL, native SQL mapping, pagination, query cache, statistics and batch work.
  9. 56 Auditing and Soft Deletes with Hibernate Envers Track who changed what and when - Hibernate Envers @Audited revisions, AuditReader queries, Spring Data auditing with @CreatedDate and @CreatedBy, and soft deletes with @SQLDelete and @SoftDelete.

Spring Framework

  1. 57 Spring Framework Introduction What the Spring Framework is and why most Java backends use it - inversion of control, the module map, Spring vs Jakarta EE and Spring Boot, and Spring 7 / Boot 4.
  2. 58 Dependency Injection and Inversion of Control Learn dependency injection in Java - why tight coupling hurts, constructor vs setter vs field injection, a working DI container built with reflection, and Spring's version.
  3. 59 Beans, Configuration and Component Scanning Define Spring beans with @Component and @Bean, understand @Configuration proxies, scopes, lifecycle callbacks, @Primary and @Qualifier, and profiles, with runnable models.
  4. 60 Spring XML Configuration, BeanFactory and ApplicationContext Read and write Spring's classic beans.xml - property and constructor injection, autowire modes, init and destroy methods - and learn how BeanFactory differs from ApplicationContext.
  5. 61 Spring Expression Language (SpEL) and @Value Learn the difference between ${...} and #{...}, inject values with @Value, use SpEL operators, selection and safe navigation, and master every autowiring mode.
  6. 62 Aspect-Oriented Programming Learn Spring AOP - cross-cutting concerns, aspects, advice and pointcuts, @Around timing, how proxies work (built with java.lang.reflect.Proxy) and the self-invocation trap.
  7. 63 Spring AOP: XML Configuration and the Classic Advice API Read and migrate older Spring AOP code - aop:config with aop:aspect, ProxyFactoryBean, MethodBeforeAdvice, AfterReturningAdvice, ThrowsAdvice and MethodInterceptor.
  8. 64 Spring JDBC with JdbcTemplate and JdbcClient Learn Spring JDBC: JdbcTemplate, RowMapper and ResultSetExtractor, named parameters, SimpleJdbcInsert, batches, JdbcClient, exception translation, @Transactional.
  9. 65 Spring ORM: LocalSessionFactoryBean and HibernateTransactionManager Read classic Spring and Hibernate wiring - LocalSessionFactoryBean, HibernateTransactionManager, getCurrentSession and HibernateTemplate - and learn how to migrate such code to JPA step by step.
  10. 66 Spring MVC How Spring MVC handles a web request - the DispatcherServlet, handler mappings, controllers, models, view resolvers, Thymeleaf templates and redirects.
  11. 67 Spring MVC Without Boot: Java Config, web.xml and WAR Deployment Build a classic Spring MVC web app without Spring Boot - the dispatcher initializer, WebMvcConfigurer, several view resolvers, @PropertySource values and WAR deployment to Tomcat.
  12. 68 Spring MVC: File Upload and Pagination Handle file uploads with MultipartFile and paginate long lists with Page and PageRequest in Spring MVC, with the same ideas in plain servlets and runnable plain-Java models.
  13. 69 Spring Transactions and Events Understand @Transactional propagation, rollback rules and read-only mode, then decouple code with application events and @TransactionalEventListener, with runnable models.

Spring Boot

  1. 70 Spring Boot Introduction What Spring Boot adds to Spring - auto-configuration, starters, an embedded server and executable JARs - and how to create, structure and run your first project.
  2. 71 Configuration, Properties and Profiles Configure Spring Boot apps - application.properties and YAML, @Value, type-safe @ConfigurationProperties records, profiles, environment variables and override order.
  3. 72 Building REST APIs with Spring Boot Build JSON REST APIs with Spring Boot - @RestController, @GetMapping and friends, path variables, query parameters, request bodies, ResponseEntity and Jackson.
  4. 73 Validation and Error Handling Validate Spring Boot requests with Jakarta Bean Validation (@Valid, @NotBlank, @Size, custom constraints) and return consistent ProblemDetail errors from @RestControllerAdvice.
  5. 74 Spring Data JPA Use Spring Data JPA repositories - JpaRepository, derived query methods, @Query, projections, paging and sorting, auditing - with the SQL each one runs, live on H2.
  6. 75 Spring Data REST, Spring Data LDAP and Routing DataSources Export repositories as a REST API with Spring Data REST, read LDAP directories through Spring Data LDAP, and route each tenant to its own database with AbstractRoutingDataSource, with runnable models.
  7. 76 Testing Spring Boot Applications Test Spring Boot apps at the right level - plain unit tests, @WebMvcTest with MockMvc, @DataJpaTest, @SpringBootTest, @MockitoBean, context caching and Testcontainers.
  8. 77 Spring Security How Spring Security protects a Spring Boot app - the security filter chain, authentication and authorization, SecurityFilterChain rules, password encoders and method security.
  9. 78 Registration, Email Activation and Password Reset with Spring Security Build the account lifecycle around Spring Security - registration with password hashing, activation tokens by email, resend, password reset and lockout after failed logins.
  10. 79 Spring Security: Two-Factor Auth, API Keys and Role Hierarchy Add TOTP two-factor login, an API-key filter, a RoleHierarchy, @PreFilter and @PostFilter, view-level security tags and per-profile security switches to Spring Security.
  11. 80 JWT and OAuth 2 Learn how JSON Web Tokens work by building and verifying HS256 and RS256 tokens in plain Java, then secure Spring Boot APIs with OAuth 2 and OpenID Connect.
  12. 81 Actuator, Metrics and Observability Make Java services observable - Spring Boot Actuator health and info endpoints, Micrometer metrics, Prometheus, distributed tracing and structured production logs.
  13. 82 Scheduling, Caching and Async Tasks Run background jobs with @Scheduled, speed up reads with @Cacheable and run work in parallel with @Async, each rebuilt in plain Java so you understand the pitfalls.
  14. 83 WebSockets with Jakarta and Spring Learn how the WebSocket handshake and frames work, then build real-time features with Jakarta endpoints, Spring handlers and STOMP messaging over a broker.
  15. 84 GraphQL with Spring Learn how GraphQL schemas, queries and resolvers work by building a mini executor, then use Spring for GraphQL with @QueryMapping, @SchemaMapping and batching.
  16. 85 Server-side Views with Thymeleaf Render HTML on the server with Thymeleaf and Spring MVC, from th:text and th:each to form binding and validation, fragments, the post-redirect-get pattern and XSS-safe output.
  17. 86 Caching and Data with Redis Use Redis from Spring Boot as a cache and data store, from how the protocol works to RedisTemplate and @Cacheable with TTL, plus serialization and common pitfalls.
  18. 87 OAuth 2 Resource Server and Login Secure a Spring Boot API with OAuth 2 and JWTs - resource server setup, JWKS keys, audience validation, role mapping, 401 vs 403, plus OIDC login and service-to-service tokens.
  19. 88 Batch Processing with Spring Batch Learn Spring Batch - jobs, steps, chunk-oriented processing, readers, processors and writers, job parameters, restart, skip and retry, with runnable models of each idea.
  20. 89 OpenAPI and Swagger Docs Document a Spring Boot REST API with OpenAPI 3 and springdoc. Learn the spec structure, annotations, Swagger UI, code-first versus contract-first, and spotting breaking changes.
  21. 90 Sending Email with Jakarta Mail and Spring Mail Send email from Java with Jakarta Mail and Spring's JavaMailSender - SMTP and TLS, MimeMessage, HTML, attachments, templates, async sending and test mail servers like Mailpit and GreenMail.

Architecture and Deployment

  1. 91 Layered Architecture: Controllers, Services and Repositories Structure Java backends in layers - controllers, services and repositories, DTOs versus entities, mapping, transaction boundaries and a runnable layered mini app.
  2. 92 Microservices Learn when microservices help, how to draw service boundaries, and how gateways, discovery, timeouts, retries and circuit breakers work, with runnable Java demos.
  3. 93 Messaging with Kafka and RabbitMQ Learn asynchronous messaging in Java - queues versus topics, Kafka partitions and consumer groups, RabbitMQ exchanges, delivery guarantees, idempotency and the outbox.
  4. 94 Reactive Programming Understand reactive programming in Java - Reactive Streams, backpressure, java.util.concurrent.Flow with SubmissionPublisher, Project Reactor, WebFlux and virtual threads.
  5. 95 Docker for Java Developers Package Java and Spring Boot apps with Docker - multi-stage Dockerfiles, layered JARs, docker compose with PostgreSQL, JVM memory and CPU limits, and graceful shutdown.
  6. 96 Deploying Java Applications Deploy Java services to production - executable JARs, environment configuration, database migrations, cloud options, Kubernetes basics, GraalVM native images and CI/CD.
  7. 97 Database Migrations with Flyway Manage database schema changes with Flyway in Spring Boot, from versioned and repeatable migrations and checksums to baselines for existing databases, repair and safe team workflows.
  8. 98 JNDI and JMX Management Learn JNDI naming lookups and DataSource resources, then JMX MBeans, MXBeans, notifications and remote monitoring with JConsole, plus Spring, Actuator and security tips.
  9. 99 Native Images with GraalVM Compile Java to a native executable with GraalVM Native Image - how ahead-of-time compilation works, why reflection needs metadata, Spring AOT, build commands and trade-offs.
  10. 100 Quarkus and Micronaut Compared Compare Quarkus and Micronaut with Spring Boot - build-time dependency injection, startup and memory, native images, code samples, dev experience and how to choose.
  11. 101 JMS and Message Queues Learn Jakarta Messaging (JMS) - queues versus topics, durable subscriptions, selectors, acknowledgement, redelivery and dead-letter queues, request-reply, and Spring Boot listeners.
  12. 102 Deploying Java to Kubernetes Run Spring Boot on Kubernetes properly - liveness, readiness and startup probes, graceful shutdown, memory and CPU requests and limits, JVM sizing, ConfigMaps, Secrets and troubleshooting.

Spring Cloud

  1. 103 Service Discovery with Eureka Learn how services find each other - client-side and server-side discovery, Eureka server and clients, heartbeats, leases, self-preservation and Kubernetes DNS.
  2. 104 Load Balancing and OpenFeign Spread calls across service instances with Spring Cloud LoadBalancer, and write declarative HTTP clients with OpenFeign and Spring's @HttpExchange interfaces.
  3. 105 API Gateway with Spring Cloud Gateway Build an API gateway - routes, predicates and filters, rate limiting, authentication at the edge and request aggregation, with runnable Java demos and Spring Cloud Gateway.
  4. 106 Centralized Configuration with Spring Cloud Config Serve configuration for many services from Git with Spring Cloud Config. Learn profiles, labels, client import, refresh, Spring Cloud Bus, secrets and ConfigMaps.
  5. 107 Circuit Breakers and Resilience with Resilience4j Build resilient Java services with Resilience4j - sliding-window circuit breakers, retries with jitter, bulkheads, rate limiters, time limiters and fallbacks in Spring.
  6. 108 Distributed Tracing with Micrometer and Zipkin Follow one request across Java microservices. Learn spans, W3C traceparent propagation, Micrometer Tracing with OpenTelemetry or Brave, Zipkin, sampling and log correlation.

Projects

  1. 109 Project: Library Database with JDBC Build a complete library app in Java with JDBC and H2 - schema and constraints, a DAO layer, transactional loans, join-based reports, a console UI and JUnit tests.
  2. 110 Project: A REST API from Scratch Build a complete JSON task API in plain Java - layered design, H2 repository, validation, problem details, pagination, PATCH, an HttpClient script and JUnit tests.
  3. 111 Project: Task API with Spring Boot Rebuild a JSON task API with Spring Boot 4 - entities, Spring Data JPA, Bean Validation, ProblemDetail errors, paging, PATCH, optimistic locking and slice tests.
  4. 112 Project: Spring MVC CRUD with MySQL Build a server-rendered inventory app with Spring MVC, Thymeleaf, Spring Data JPA, Flyway and MySQL - list with search and paging, add, edit, delete, validation and tests.
  5. 113 Project: Banking Application with JDBC Build a banking app in Java with JDBC and H2 - a double-entry ledger, deposits and transfers in transactions, row locks, idempotent requests, statements and JUnit tests.
  6. 114 Project: Login and Registration with Servlets, JSP and JDBC Build a classic Java web app with servlets, JSP, JSTL and JDBC - registration, password hashing, login and logout with sessions, an auth filter and CSRF tokens.
  7. 115 Project: Employee Management with Spring Data JPA Build an employee management API with Spring Boot and Spring Data JPA: related entities, query methods, specifications, paging, DTOs, validation and tests.
  8. 116 Project: Task Management Microservices Build task management microservices in Java: user and task services, service discovery, an API gateway, a circuit breaker, tracing and Docker Compose.

Practice and Review

  1. 117 Advanced Java Cheat Sheet A dense Advanced Java cheat sheet with JDBC, Jackson, JUnit 6, HttpClient, Servlets, JPA annotations, Spring and Spring Boot annotations, and Maven and Gradle commands.
  2. 118 Advanced Java Interview Questions 50 Advanced Java interview questions with concise answers on JDBC, JPA and Hibernate, Spring, Spring Boot, REST, testing, microservices and security.
  3. 119 Servlet and JSP Interview Questions Servlet and JSP interview questions with clear answers: HttpServlet, RequestDispatcher, sessions, cookies, URL rewriting, filters, listeners, JSP lifecycle, scopes and more.