Java Tutorials, Tips & Tricks

How to Redirect Standard Output/Error in Java

System.out and System.err stream objects are mapped to “standard” output and error stream respectively. By default, Java display standard output/error on display console. Thus, when we print a statement using System.out: It prints the...

Read / Write Excel file in Java using Apache POI

Read / Write Excel file in Java using Apache POI

Apache POI is a powerful Java library to work with different Microsoft Office file formats such as Excel, Power point, Visio, MS Word etc. The name POI was originally an acronym for Poor Obfuscation Implementation,...

How to update JSTL Locale dynamically

How to update JSTL Locale dynamically

When you use JSTL format tag <fmt:formatDate> and <fmt:formatNumber>, JSTL automatically takes care of locale resolution. Depending on the browser’s locale setting JSTL will display the date and numbers. You may want to override this default behavior....

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...