国王陛下万万岁

导航

 
1 2 3 4 5 ··· 13 下一页

2024年1月1日

摘要: sudo apt install openssh-server sudo apt install openssh-client Ubuntu官方lianjie: https://ubuntu.com/server/docs/service-openssh 阅读全文
posted @ 2024-01-01 22:14 国王陛下万万岁 阅读(36) 评论(0) 推荐(0) 编辑
 
摘要: services: db: image: mysql:8.2.0 container_name: mysql volumes: - db_data:/var/db/mysql restart: always environment: MYSQL_ROOT_PASSWORD: su123.com MY 阅读全文
posted @ 2024-01-01 21:53 国王陛下万万岁 阅读(28) 评论(0) 推荐(0) 编辑
 

2022年10月23日

摘要: 要想让@Value注解获得properties文件当中的值,第一步需要Spring容器加载properties文件。 这就需要在配置类里面使用@PropertySoource注解来知道properties文件的路径了。 配置类代码: package com.oxygen.config; import 阅读全文
posted @ 2022-10-23 02:21 国王陛下万万岁 阅读(39) 评论(0) 推荐(0) 编辑
 
摘要: 简单数据类型用@Value注解自动装配赋值,String是简单类型 引用数据类型用@Autowired注解自动装配。引用类型指的是Java类对象。 通过@Value注解直接赋值: @Value("2011000991") private int bookSN; 阅读全文
posted @ 2022-10-23 02:10 国王陛下万万岁 阅读(85) 评论(0) 推荐(0) 编辑
 
摘要: @Autowired用来配置类与类之间的依赖关系,即,一个类要调用另一个类的对象时就可以通过这个注解来自动装配。 1.BookDaoImpl类: package com.oxygen.dao.impl; import com.oxygen.dao.BookDao; import org.spring 阅读全文
posted @ 2022-10-23 01:45 国王陛下万万岁 阅读(231) 评论(0) 推荐(0) 编辑
 
摘要: 1.Bean的作用域,其实就是bean采用单例模式还是非单例模式 放在网络编程环境是指bean在http请求的作用范围的过程 ! 在java类上加上@Scope注解,可以设置bean的作用范围 package com.oxygen.dao.impl; import com.oxygen.dao.Bo 阅读全文
posted @ 2022-10-23 01:07 国王陛下万万岁 阅读(94) 评论(0) 推荐(0) 编辑
 

2022年10月22日

摘要: 1.使用xml配置文件配置Spring容器: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.spr 阅读全文
posted @ 2022-10-22 23:52 国王陛下万万岁 阅读(141) 评论(0) 推荐(0) 编辑
 
摘要: 1.回顾以下我们用xml文件配置spring的方法,用标签定义了一个java类,或者说是java bean。用标签给java bean当中的属性赋值。 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springfram 阅读全文
posted @ 2022-10-22 21:07 国王陛下万万岁 阅读(488) 评论(0) 推荐(0) 编辑
 
摘要: 1.用逗号隔开,写上多个properties文件的名字 < context:property-placeholder location="jdbc.properties,jdbc2.properties" system-properties-mode="NEVER"/> 2.使用通配符:* <con 阅读全文
posted @ 2022-10-22 18:24 国王陛下万万岁 阅读(565) 评论(0) 推荐(0) 编辑
 
摘要: 1.以下是Spring配置连接Mysql的Druid数据源的xml配置。 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http 阅读全文
posted @ 2022-10-22 18:14 国王陛下万万岁 阅读(162) 评论(0) 推荐(0) 编辑
 
1 2 3 4 5 ··· 13 下一页