• Java MySQL BLOB data read / write operation


    ​ package com.lw.database; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; /** * CREATE: CREATE TABLE IDCard ( id char(18),pic BLOB); * @author fhadmin * from www.fhadmin.cn */ public class LOBTest { protected static final String DEFAULT_URL = “jdbc:mysql://”; protected static final String DRIVER_NAME = […]

  • Redis – expiration policy and memory elimination mechanism


    Expiration Policies 1、 Scene application Problem: for example, you can only store 5g data in redis, but if you write 10g, 5g data will be deleted. Have you ever thought about how to delete it? Also, your data has set the expiration time, but when the time comes, the memory utilization is still relatively high. […]

  • Springboot2 initializer: mappropertysource and others


    exceptMapPropertySourceBesides, there are others, such as:CompositePropertySource Request:http://localhost:9999/acInitializer/first/map1-k1You can get it becauseMapPropertySourceAdded;http://localhost:9999/acInitializer/first/map2-k1http://localhost:9999/acInitializer/first/map3-k1It can be becauseCompositePropertySource CompositePropertySourceExample: package com.niewj.fileman.initialized; import org.springframework.context.ApplicationContextInitializer; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.core.annotation.Order; import org.springframework.core.env.CompositePropertySource; import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.MapPropertySource; import org.springframework.core.env.PropertySource; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; /** * @Author weijun.nie * @Date 2020/4/27 8:00 * @Version 1.0 */ @Order(1) public class FirstACInitializer […]

  • What are the expiration policies of redis?


    We usually use memory as cache, but is memory infinite? Of course not. Memory is precious and limited. It is possible that a machine has more than ten gigabytes of memory, but it can hold a few tons of hard disk space. Reids mainly performs high-performance, high concurrency read-write operations based on memory. So here […]

  • Redis’s memory recovery principle and memory expiration elimination strategy


    Redis memory recovery mechanism Redis’s memory recovery mainly focuses on the following two aspects: 1. Redis expiration policy: delete key value of expiration time 2. Redis elimination strategy: memory knockout data triggered when memory usage reaches maxmemory upper limit Redis’s expiration strategy and memory obsolescence strategy are not one thing. Don’t confuse them in actual […]

  • What is the difference between set and set in Java?


    As you may know, the unbounded wildcard set > can hold any type of element, and the original type set can hold any type of element. What’s the difference between them? 1. Two facts about set > There are two facts about set > Item 1:? Represents any type. Set > can hold any type […]

  • PHP script l exports mysq blob format data-hex and unhex usage


    Preface We’ve introduced the use before.PHP script export SQL statementTo the process and points of attention in the test clothes, there is a problem that has not been solved before, that is, blob type data in MySQL is not successfully imported. This time we found a solution. Here’s a record. What is the blob type? […]