-
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]】
阅读更多 -
Spring Boot JDBC Examples
In this tutorial, we will show you how to use Spring Boot JDBC JdbcTemplate and NamedParameterJdbcTemplate.
轻舞肥羊2019-08-11【[Java]】
阅读更多 -
Spring Boot JDBC Stored Procedure Examples
In this tutorial, we will show you how to use Spring Boot JDBC SimpleJdbcCall to call a stored procedure and stored function from a Oracle database.
轻舞肥羊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]】
阅读更多 -
Spring JdbcTemplate Handle Large ResultSet
Spring JdbcTemplate example to get a large ResultSet and process it.
轻舞肥羊2019-08-11【[Java]】
阅读更多 -
MySQL / MariaDb + Hibernate XML Configuration Example
This tutorial shows you how to configure MySQL/MariaDB with Hibernate using XML Configuration. We demonstrate this by inserting a POJO into the database. This POJO and database are configured using XML Configuration.
轻舞肥羊2019-08-10【[Java]】
阅读更多 -
MySQL / MariaDb + Hibernate Annotation Configuration Example
轻舞肥羊2019-08-10【[Java]】
阅读更多 -
Hibernate c3p0 Connection Pooling Configuration
This tutorial shows you how to configure Hibernate c3p0 Connection Pooling. By default hibernate comes with a built-in connection pool. But this connection pool is by no means production ready. They even advice not to use it in production, as you can see in the logging.
轻舞肥羊2019-08-10【[Java]】
阅读更多 -
Configure Hibernate Logging with SLF4j + Logback
This tutorial shows how to configure hibernate with SLF4j and Logback. Logging is an important tool for each developer. So it’s worth setting up right the first time. We configure Logback with a ConsoleAppender for logging to the console and a RollingFileAppender for logging to a file for archival. If you stick around, we’ll also show you how to remove the annoying c3p0 logging.
轻舞肥羊2019-08-10【[Java]】
阅读更多 -
Configure Hibernate Logging with slf4j + log4j2
This tutorial shows how to configure hibernate with slf4j and log4j2. Logging is an important tool for each developer. So it’s worth setting up right the first time. We configure two logging appenders. The first is for logging to the console, the second is for logging to a file for archival reasons.
轻舞肥羊2019-08-10【[Java]】
阅读更多 -
Hibernate Dbcp Connection Pooling Configuration
This tutorial shows you how to configure Hibernate dbcp Connection Pooling. By default hibernate comes with a built-in connection pool. But this connection pool is by no means production ready. They even advice not to use it in production, as you can see in the logging.
轻舞肥羊2019-08-10【[Java]】
阅读更多