The first step is of course to install Redis. Here we take the installation on Windows as an example.
First download Redis, you can choose msi or zip package installation method
zip method needs to open the cmd window and run it in the decompressed directory redis-server redis.windows.conf
Start Redis
After installation in msi mode, Redis starts by default and does not require any configuration
You can modify the Redis port number, password and other configurations in the redis.windows.conf file. After the modification is completed, use the redis-server redis.windows.conf
command to restart
Execute in the Redis installation directoryredis-cli -h 127.0.0.1 -p 6379 -a Password
Open the Redis operation interface
If an error (error) ERR operation not permitted
is reported, use auth password
for verification
Redis integration is carried out directly based on the framework integration of SSM in the previous article. It should be noted here that the pojo class stored in Redis must implement Serializable
interface .
1 2 3 4 5 6 7 |
|
1 2 3 4 5 6 7 8 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
F5 to refresh the page. You can see from the Tomcat console that there is no progress. SQL query, but reads cached data directly from Redis, reducing the burden on the database
The above is the detailed content of Detailed explanation of SSM integration with Redis in Java. For more information, please follow other related articles on the PHP Chinese website!