摘要: 1 <?xml version="1.0" encoding="UTF-8"?> 2 <beans xmlns="http://www.springframework.org/schema/beans" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-in 阅读全文
posted @ 2021-07-15 20:22 yub4by 阅读(61) 评论(0) 推荐(0)
摘要: Spring原始注解 Spring是轻代码而重配置的框架,配置比较繁重,影响开发效率,所以注解开发是一种趋势,注解代替xml配置文件可以简化配置,提高开发效率。 1 <?xml version="1.0" encoding="UTF-8"?> 2 <beans xmlns="http://www.s 阅读全文
posted @ 2021-07-15 19:48 yub4by 阅读(62) 评论(0) 推荐(0)
摘要: 数据源(数据库连接池)的作用 数据源的开发步骤 数据源的手动创建 VS Spring配置数据源 虽然将数据库基本连接信息配置到applicationContext.xml中已经完成解耦合,但是实际开发中方便数据库的管理,同样会将数据库的基本连接信息单独抽取到一个properties文件中 代码 po 阅读全文
posted @ 2021-07-15 18:39 yub4by 阅读(53) 评论(0) 推荐(0)
摘要: 1 // ApplicationContext app = new ClassPathXmlApplicationContext("applicationContext.xml"); 2 ApplicationContext app = new FileSystemXmlApplicationCon 阅读全文
posted @ 2021-07-15 13:26 yub4by 阅读(44) 评论(0) 推荐(0)
摘要: 单例scope="singleton" 多例scope="prototype" 1 <?xml version="1.0" encoding="UTF-8"?> 2 <beans xmlns="http://www.springframework.org/schema/beans" 3 xmlns: 阅读全文
posted @ 2021-07-15 11:37 yub4by 阅读(75) 评论(0) 推荐(0)