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

手机网站单页怎么做网络建设推广

手机网站单页怎么做,网络建设推广,免费网页加速器,做实体店打折信息网站【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.hkea.cn/news/109911/

相关文章:

  • vps 网站上传网站seo优化是什么意思
  • wordpress cos腾讯云seo网站优化收藏
  • 鹤岗商城网站建设免费域名申请
  • 江苏三个地方疫情严重抖音视频排名优化
  • 竞价排名广告东莞关键词排名快速优化
  • 做视频网站要什么格式好网络营销公司怎么注册
  • 企业专业网站建设快速网站搭建
  • 武威建设网站的网站google谷歌搜索
  • 长沙公司做网站多少钱推广平台怎么做
  • 现在大家做电商网站用什么源码营销策略都有哪些
  • 可以做试卷的网站英语怎么说seo关键词排名优化系统源码
  • 网站怎么设置支付功能企业网站的主要类型有
  • 成都圣都装饰装修公司北京搜索优化排名公司
  • 境外建设网站贴吧互联网域名注册查询
  • 广州建站工作室淘客推广怎么做
  • 中国最大的网站建设公司百度广告联盟点击一次多少钱
  • wordpress单页主题营销seo手机关键词网址
  • dedecms做电影网站韩国最新新闻
  • 哪个网站做废旧好如何在百度上发布自己的广告
  • 网站表单及商品列表详情模板如何搭建自己的网站
  • 网站域名登记证明百度高级搜索怎么用
  • 国外网站在国内做镜像站点网站搭建费用
  • 网站后台如何添加关键词软件开发公司
  • 手机做网站的网站windows优化大师卸载不了
  • 万网速成网站有哪些 功能自己的网站怎么推广
  • 邯郸哪有做网站的河南百度推广公司
  • 我是做环保类产品注册哪些浏览量大的网站推销自己的产品比较好呢西安网站seo优化公司
  • 网页传奇游戏排行昆明网络推广优化
  • 商城模板网站模板网站软文是什么
  • 校园网站推广方案怎么做网站排名推广工具