Home » Java

Java

Migration Advice for Java 10

Hello there once again to another hot shot. My name is Peter Pilgrim, Platform engineer and DevOps specialist, Java Champions. As you know Java 9 introduced a module system. You probably are migrating your services to JDK 10 and beyond or at least thinking. My general advice to business is, the sooner you migrate the better your technical debt will ...

Read More »

Thinking of Java 10 and beyond

Hello once again. Java 10 was released on 20th March 2018. I think many software teams will hold back from upgrading to it. Even lesser numbers of professional probably still have yet to make a move from Java 8 to Java 9. Why would this be the case, because of legacy impediments and dependencies on application servers, frameworks and even ...

Read More »

Apache Derby Database Users and Permissions

Abstract Apache Derby is awesome! Especially in a Microservices environment where the data for services (may) shrink and not require a heartier RDBMS. Derby is awesome because it’s so easy to use, especially when it come to users and permissions – you don’t need any! But, it may be the case you want to create an application-level user with limited ...

Read More »

Making Pivot Tables with Java Streams from Databases

Raw data from database rows and tables does not provide so much insight to human readers. Instead, humans are much more likely to see data patterns if we perform some kind of aggregation on the data before it is being presented to us. A pivot table is a specific form of aggregation where we can apply operations like sorting, averaging, ...

Read More »

New JDK 11 Files Method isSameContent()

It has been proposed that a method named isSameContents() be added to the Files class in JDK 11 via JDK-8202285 [“(fs) Add a method to Files for comparing file contents”]. Proposed by Joe Wang, this new method is “intended to be an extension to the existing isSameFile method since it stopped short of comparing the content to answer the query ...

Read More »

TestContainers and Spring Boot

spring-interview-questions-answers

TestContainers is just awesome! It provides a very convenient way to start up and CLEANLY tear down docker containers in JUnit tests. This feature is very useful for integration testing of applications against real databases and any other resource for which a docker image is available. My objective is to demonstrate a sample test for a JPA based Spring Boot ...

Read More »

New JDK 11 Files Methods for Reading/Writing Strings From/To Files

My previous post focused on the Files.isSameContent() method that is likely to be added to JDK 11. JDK-8201276 [“(fs) Add methods to Files for reading/writing a string from/to a file”] mentions this new method and also highlights the methods that are the subjects of this post: readString(Path) readString(Path, Charset) writeString(Path, CharSequence, OpenOption...) writeString(Path, CharSequence, Charset, OpenOption...) Joe Wang recently posted ...

Read More »

Using Java Stream summary statistics

Streams of primitive types (IntStream, etc.) provide a summaryStatistics() method that can be used to get multiple statistical properties of a stream (minimum value, average value, etc.). Assume we have a list of people. Our goal is to get the minimum and maximum age of the people in the list using streams. The problem here is that the computation of ...

Read More »

Secure a Spring Microservices Architecture with Spring Security and OAuth 2.0

spring-interview-questions-answers

“I love writing authentication and authorization code.” ~ No Java Developer Ever. Tired of building the same login screens over and over? Try the Okta API for hosted authentication, authorization, and multi-factor auth. Every developer wants to build faster and more efficiently, to support scale. Building a microservices architecture with Spring can add resilience and elasticity to your architecture that ...

Read More »