Wednesday, December 30, 2020

Testing with Hoverfly and Java Part 5: XML and Xpath matchers

Previously we worked with some of the existing Hoverfly matchers like the regex, glob and exact.Each one serves its purpose but we might want some rules that assist us with the format of the data exchanged through our requests.On this blog we will focus on the matchers for...

Monday, December 28, 2020

Java’s String.repeat Method in Action: Building PreparedStatement with Dynamic Number of Parameters

Java’s String.repeat(int) method is an example of a “small” addition to Java (JDK 11) that I find myself frequently using and appreciating. This post describes use of JDK 11-introduced String.repeat(int) for easier custom generation of SQL WHERE clauses with the appropriate number of “?” parameter placeholders for use...

Saturday, December 26, 2020

Debugging a Java Program with Eclipse

One of the benefits that Eclipse provides is the ability to run code interactively by using its integrated debugger. Examining variables and expressions while executing code step-by-step is an invaluable tool for investigating problems with your code. This excerpt from Chapter 2 of Eclipse in Action: A guide...

Friday, December 25, 2020

Constrast DataWeave and Java mapping operations

Main points:◉ DataWeave 2.0 provides mapping capabilities◉ Java and DataWeave can achieve the same mappings◉ DataWeave mapping operator is less verbose than JavaDataWeave map operatorThe DataWeave 2.0 (Mule 4) map operator shares similarities with the map() method from Java’s Stream class.Mapping is a transformative operationThe idea of mapping...

Wednesday, December 23, 2020

Java – Get Time In MilliSeconds

A quick guide to get the current date time in milliseconds using Date, Calendar and java 8 api classes.1. OverviewIn this tutorial, We’ll learn how to get the time in milliseconds in java. Time in milliseconds is the right way and format in storing into the database for...

Monday, December 21, 2020

Java Program To Check Palindrome String Using Recursion

1. OverviewIn this tutorial, We’ll learn how to check the string is palindrome using Recursive function in java.String palindrome means if the string reversed value is equal to the original string.Recursion means calling the one function from the same function. This is a computer programming concept and it...

Friday, December 18, 2020

Converting Between LocalDate and SQL Date In Java 8

A quick guide to convert between LocalDate and java.sql.Date objects in java 8 with examples.1. OverviewIn this tutorial, We’ll learn how to convert java.time.LocalDate to java.sql Date in java 8 and vice versa.This is simple to do but when working jpa framework it is bit different to deal...

Thursday, December 17, 2020

Static vs Dynamic Binding in Java

Static Binding: The binding which can be resolved at compile time by compiler is known as static or early binding. Binding of all the static, private and final methods is done at compile-time.Why binding of static, final and private methods is always a static binding?Static binding is better...

Wednesday, December 16, 2020

How to find if JVM is 32 or 64 bit from Java program

You can find JVM bit size e.g. 32 bit or 64 bit by using either running java command from the command prompt or by using System.getProperty() from Java program. The question is why do you want to know hardware or platform configuration while writing Java code which is...

Tuesday, December 15, 2020

AWS SDK 2 for Java and storing a Json in DynamoDB

AWS DynamoDB is described as a NoSQL key-value and a document database. In my work I mostly use the key-value behavior of the database but rarely use the document database features, however  the document database part is growing on me and this post highlights some ways of using...

Pages (26)1234567 »