Use \d or \d+ in psql command to show all tables. \d+ will show additional detail of tables;
The annotation @ResponseBody can help you convert object to json. Sometimes if the field of object is null the json returned like following.
Use set command to list all environment variables. They are like following in my computer.
Use du command to show the size of folder. Before testing this command we will create a directory and a file.
In PosgreSQL there are several ways to switch database.
In PostgreSQL there are two ways to list all databases.
When I start tomcat to deploy my application I got the error message like following.
It's easy to use Apache POI read excel file. Let's say you have an excel file. The path of it is D:\test.xlsx. The content is like following.
We can convert list to map easily in Java8 by using stream. The sample code is like following.
Executors.newFixedThreadPool(3) method will create a thread pool with only 3 threads. When we put Runnable or Callable object into the thread pool. The thread pool will create new thread for running task. When the number of threads equals the pool size the new task will be queued. The code below may help you have a better understanding of the the method newFixedThreadPool().
There are several ways to show indexes for a table in MySQL. Let's say you have create the table in your database. The schema of table is here.
Executors.newCachedThreadPool() method will create a thread pool which core pool size is 0 and max pool size is Integer.MAX_VALUE. The detail of constructor function is here:
This series of blog describes mainly how to use common classes of JDK.
map function in Stream class means you can pass Function and get another Stream result. It is very useful when you want convert collection to another collection. In this page I'll give you a demonstration how to convert list of User to a list of user's name and age.
When we create ThreadPoolExecutor we need to specify the size of core and maximun. Let's say you create a executor, the corePoolSize is 2, the maximumPoolSize is 4. In general, there are 2 threads working. If the third task created it will be added in the queue. When the queue is full the executor will create a new thread for handling the new task. New tasks will be rejected when the size of pool is equal with maximumPoolSize and the queue is full.