当前位置: 首页 > news >正文

做图标的网站杭州seo营销

做图标的网站,杭州seo营销,网站独立主机,怎么免费从网站上做宣传【Spring连载】使用Spring Data访问Redis&#xff08;一&#xff09;----快速指南 一、导入依赖二、Hello World程序 一、导入依赖 在pom.xml文件加入如下依赖就可以下载到spring data redis的jar包了&#xff1a; <dependency><groupId>org.springframework.boot…

【Spring连载】使用Spring Data访问Redis(一)----快速指南

  • 一、导入依赖
  • 二、Hello World程序

一、导入依赖

在pom.xml文件加入如下依赖就可以下载到spring data redis的jar包了:

		<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-redis</artifactId></dependency><dependency><groupId>redis.clients</groupId><artifactId>jedis</artifactId></dependency>

二、Hello World程序

首先,你需要设置一个正在运行的Redis服务器。Spring Data Redis 需要Redis 2.6或更高版本,并且Spring Data Redis集成了Lettuce和Jedis这两个流行的开源Java库。现在,你可以创建一个简单的Java应用程序,用于向Redis存储和读取值。创建要运行的主应用程序,示例如下:

public class RedisApplication {private static final Log LOG = LogFactory.getLog(RedisApplication.class);public JedisConnectionFactory jedisConnectionFactory() {RedisStandaloneConfiguration redisStandaloneConfiguration =new RedisStandaloneConfiguration();redisStandaloneConfiguration.setHostName("localhost");redisStandaloneConfiguration.setDatabase(0);redisStandaloneConfiguration.setPassword(RedisPassword.of("123456"));redisStandaloneConfiguration.setPort(6379);return new JedisConnectionFactory(redisStandaloneConfiguration);}public static void main(String[] args) {JedisConnectionFactory connectionFactory = new RedisApplication().jedisConnectionFactory();connectionFactory.afterPropertiesSet();RedisTemplate<String, String> template = new RedisTemplate<>();template.setConnectionFactory(connectionFactory);template.setDefaultSerializer(StringRedisSerializer.UTF_8);template.afterPropertiesSet();template.opsForValue().set("foo", "bar");LOG.info("Value at foo:" + template.opsForValue().get("foo"));connectionFactory.destroy();}
}

即使在这个简单的示例中,也有一些值得注意的事情需要指出:

  • 你可以使用RedisConnectionFactory创建RedisTemplate的实例(或ReactiveRedisTemplate,用于响应式使用)。连接工厂是在支持的驱动程序之上的抽象。
  • 没有单一的方法来使用Redis,因为它支持广泛的数据结构,如plain keys(“strings”),lists, sets, sorted sets, streams, hashes等等。
http://www.khdw.cn/news/64587.html

相关文章:

  • 秦皇岛建设工程信息网站十大seo公司
  • 深圳旅游网站开发一般的电脑培训班要多少钱
  • 佛山建站公司哪家好百度推广效果
  • 优惠券的网站怎么做的品牌营销的四大策略
  • 网站建设收费百度搜索风云榜排行榜
  • 南宁网站设计报价seo排名技术软件
  • 西宁市建设网站公司电话中央电视台新闻联播
  • 高端响应式网站开发磁力猫torrent kitty
  • 怎样给网站做推广长沙网站制作关键词推广
  • 做网页做网站的技术人才免费推广软件 推广帮手
  • 想做一个网站平台怎么做的网站建设推广专家服务
  • 高德地图显示不了台湾上海seo推广服务
  • 做淘客网站太原seo外包服务
  • 微网站怎么做的好名字吗软文撰写公司
  • 大流量网站开发免费的外链网站
  • 密云做网站免费的网站推广方法
  • 专做定制网站建设企业培训方案制定
  • 石家庄免费网站建设运营推广是做什么的
  • 网站开发php程序员seo是什么的缩写
  • 广东省住房建设厅网站6怎么在百度上推广产品
  • 淄博学校网站建设报价关键词调词平台哪个好
  • 网站建设英语翻译资料抖音怎么推广
  • iis建好的网站套用模板惠州市seo广告优化营销工具
  • wordpress 标签库引擎优化seo怎么做
  • 镇江市质监站网址百度竞价什么时候开始的
  • aspnet网站开发实例教程pdfseo关键词排名优化专业公司
  • 创新的企业网站开发北京seo薪资
  • 太原网站建设制作报价青岛seo经理
  • 青海网站建设推广seo查询网站是什么
  • 网站投票页面怎么做seo的基本工作内容