SLF4J LOG4J2 Configuration

slf4j-log4j2-configuration

Using the simple logging facade for Java (slf4j) with Apache log4j 2 is pretty straightforward and can be done literally in a minute. The slf4j allows you to plug in the desired logging framework at runtime, giving you the flexibility to change it when such a requirement is present. It’s a popular logging abstraction library […]

Continue reading >

Spring JdbcTemplate Basic Example

By Daniel Vladimirov / a couple of months ago
spring-jdbctemplate-basic-usage

In this article we’ll go through some basic examples of using JdbcTemplate, the core JDBC class in Spring. The JdbcTemplate class is the central piece of the JDBC core package. It simplifies the execution of SQL statements and promotes a clearly defined contract for developers to use the class in the form of callback interfaces. […]

Continue reading >

Spring Boot MySQL Configuration

By Daniel Vladimirov / a few months ago
spring-boot-mysql-connection-configuration

Setting up a MySQL connection with Spring Boot is fairly easy and very straightforward. This tutorial will set up a basic MySQL connection in Spring Boot, using anĀ application.yml configuration file. Most of the work for getting a MySQL connection is done behind the scenes. What is left for you is to just configure your connection, […]

Continue reading >

Spring Boot External Configuration

By Daniel Vladimirov / a few months ago
spring-boot-external-configuration

Spring Boot offers a variety of ways for you to externalize the application configuration, so that you can run your service in different environments and with different setup. The most popular configuration options are: property files and YAML files. There’s also the option to pass command line properties as well as to use environment variables. […]

Continue reading >

Spring REST Request Body Validation

By Daniel Vladimirov / a few months ago
request-body-validation-spring-rest

@RequestBody validation is important for your REST APIs, because it protects your service layer from bad input and prevents a bad request to ever reach your business logic. User input validation in Spring is not hard to implement, because of the built-in support for JSR-303 bean validation, which makes it quite straightforward for most cases […]

Continue reading >

Install MySQL from archive file

By Daniel Vladimirov / a few months ago
install-mysql-archive

This tutorial will show how to install MySQL Community Edition database server from an archive file on Windows. The reason why I prefer to install it like this is because I don’t pollute my machine with additional software that installs itself as a Windows service and gets in my PATH without me wanting it there. […]

Continue reading >

Handling GET requests with Spring Rest

By Daniel Vladimirov / a few months ago
spring-rest-get-requests

In this tutorial you’ll build a simple web application, or use the tutorial in an existing project, that handles GET HTTP requests with and without path variables. GET is one of the HTTP methods defined in the Hypertext Transfer Protocol. GET methods are used to retrieve data in a client-server based communication. The GET method, […]

Continue reading >

How to change the Spring Boot container – Tomcat to Undertow

By Daniel Vladimirov / a few months ago
springboot-container-tomcat-undertow

In this tutorial we are going to look at how we can easily change our embedded servlet container in our Spring Boot web application. If you don’t have any source code to work on, I’m going to use the same application we created in the previous article, which you can check out here https://simplyprogram.com/how-to-create-a-simple-web-application-with-spring-boot/ For […]

Continue reading >