-
java.sql.SQLException: The server time zone value xx time is unrecognized
Making a JDBC connection to the MySQL server with the latest mysql-connector-java:8.0.16 and hits the following SQLException:
Date: 2019-08-11 View: 1520
-
How to loop an enum in Java
Call the .values() method of the enum class to return an array, and loop it with the for loop:
Date: 2019-08-11 View: 1520
-
Java 8 Stream Convert List<List<String>> to List<String>
As title, we can use flatMap to convert it.
Date: 2019-08-11 View: 1520
-
Java Regular Expression Examples
Java 8 stream and regular expression examples.
Date: 2019-08-11 View: 1520
-
Java How to read last few lines of a File
In Java, we can use the Apache Commons IO ReversedLinesFileReader to read the last few lines of a File.
Date: 2019-08-11 View: 1520
-
Java How to lock a file before writing
In Java, we can combine RandomAccessFile and FileChannel to lock a file before writing.
Date: 2019-08-11 View: 1520
-
java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.Long
Below example, the jdbcTemplate.queryForList returns an object of Integer and we try to convert it into a Long directly:
Date: 2019-08-11 View: 1520