Micronaut OAuth2 Keycloak Example That Works

This post shows how to use Micronaut applications that use OAuth2 with Keycloak in a Microservice context. Furthermore, it uses two Micronaut applications. The first application allows users (or programs) to log in and acquire JWT tokens. On the other

How to configure Log4j to log to console

Okay, you wrote a lot of Log4j debug statements all over your codebase but do not want them to appear in QA and/or Production environment. How to do that? You need to configure Log4j by modifying log4j.xml. You could also use log4j.properties in place of log4j.xml but some advanced settings can only be set using the latter. Might as well use something that offers greater benefits.

How to Log to Separate Files in Log4j2

You have a batch application that reads, parses interface files (i.e., data files from other sources usually legacy systems), and inserts data into your batch application’s database. All logs are written to a single file. Now, the business starts a

Java – Closing JDBC Database Resources with try-with-resources

This post demonstrates how to use Java JDBC API with try-with-resources database resources in the following order – ResultSet, Statement, and Connection. The try-with-resources is a new exception handling mechanism that makes it easier to correctly close resources used within

How to connect Java to MySQL using JDBC

This post shows how to connect Java to MySQL using JDBC. Therefore, nothing fancy here. Just JDBC basics. MySQL JDBC Requirements We used the following items for this post. Although we can use newer versions, the Java JDBC codes pretty

docker-compose.yml For SFTP from Atmoz

This post demonstrates how to create an SFTP Docker container from Atmoz using docker-compose.yml with the most straightforward configuration to allow for developers. Sometimes we can’t just install any FTP servers on our machines. It may be due to corporate