GENERAL / CATATAN</>↗General20 Sep 2023
Welcome, future developers! If you’re looking to connect your Java applications with databases, you’re in the right place. Java Database Connectivity, commonly known as JDBC, is the bridge that links them together. It’s a powerful tool in a developer’s toolkit, allowing seamless interaction between Java and various databases. Dive into this tutorial, and by the […]
BASIC / CATATAN</>↗Basic31 Agt 2023
The following code demonstrates how to create a string of repeated characters. We use the String.repeat(int count) method introduced in Java 11. This method takes one parameter of type int which is the number of times to repeat the string. The count must be a positive number, a negative number will cause this method to […]
JAVA DATE TIME API / CATATAN</>↗Java Date Time API28 Agt 2023
Since JDK 8, we can create a datetime formatter / parser pattern that can have optional sections. When parsing a datetime string that contains optional values, for example, a date without time part or a datetime without second part, we can create a parsing pattern wrapped within the [] symbols. The [ character is the […]
APACHE POI / CATATAN</>↗Apache POI15 Apr 2023
A friend of mine told me that he has a large Excel file, and he asked me if I could split the file into multiple smaller Excel files. So I write this little program using Apache POI to do it. The code snippet below basically contains the following steps: Load the Excel as an InputStream […]
CORE API / CATATAN</>↗Core API29 Mar 2023
The Runtime.getRuntime().availableProcessors() method returns the maximum number of processors available to the Java virtual machine, the value will never be smaller than one. Knowing the number of available processor you can use it for example to limit the number of thread in your application when you are writing a multi-thread code. package org.kodejava.lang; public class […]
SPRING CORE / CATATAN</>↗Spring Core29 Mar 2023
When you use the Spring framework @Transactional annotation in your service layer you might want to see what is happening in your code related to database transaction. You want to see when a transaction is started, when it is committed or rollbacked. To activate the log for transactional message you can add the following configurations […]