-
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:
2019-08-11【[Java]】
阅读更多 -
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:
2019-08-11【[Java]】
阅读更多 -
Java 8 Stream Convert List<List<String>> to List<String>
As title, we can use flatMap to convert it.
2019-08-11【[Java]】
阅读更多 -
Java Regular Expression Examples
Java 8 stream and regular expression examples.
2019-08-11【[Java]】
阅读更多 -
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.
2019-08-11【[Java]】
阅读更多 -
Java How to lock a file before writing
In Java, we can combine RandomAccessFile and FileChannel to lock a file before writing.
2019-08-11【[Java]】
阅读更多 -
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:
2019-08-11【[Java]】
阅读更多