Java Tutorials, Tips & Tricks

Java: How to Load CSV file into Database

Java: How to Load CSV file into Database

Loading CSV file into Database can be cumbersome task if your Database provider does not offer an out of box feature for this. Most of the time you’ll spend up in creating valid insert...

Read / Write CSV file in Java

Read / Write CSV file in Java

If you want to work with Comma-separated Files (CSV) in Java, here’s a quick API for you. As Java doesn’t support parsing of CSV files natively, we have to rely on third party library. Opencsv is...

Check if String is valid Date in Java

In Java, we play a lot with Dates. Here’s one more scenario. You have a string which has date in it. You want to convert it into a valid java.util.Date object. Now in Java you can...

Java MD5 Hashing & Salting: Secure Your Passwords

Java MD5 Hashing & Salting: Secure Your Passwords

The MD5 Message-Digest Algorithm is a widely used cryptographic hash function that produces a 128-bit (16-byte) hash value. MD5 has been employed in a wide variety of security applications, and is also commonly used to check data integrity....

Batch Insert In Java – JDBC

Let’s see how we can perform batch insert in Java using JDBC APIs. Although you might already knew this, I will try to explain the basic to a bit complex scenarios.In this note, we...

Convert Arrays to Set in Java

Java Collection API is one of the most useful APIs used in any Java application. In my day to day Java coding routine, I have to deal with these APIs quite often.However sometime while...

Convert String to Enum Instance in Java

Recently while working in one of the requirement, I had to convert String values to Enum. I didn’t realize there is a simplest way of doing this. Here is the solution. Whenever an ENUM...