摘要: 1. 非加连预执释方式 2. dataSource对jdbc的支持 DataSource对象 》JdbcTemplate jdbcTemplate 》String sql = "INSERT INTO product (product_name,sale_price) VALUES (?,?)"; 阅读全文
posted @ 2020-10-28 11:37 一天从晚上开始 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 1. 将类装入容器中的方法: (1)显示写<bean></bean>的方式写在spring配置文件中; (2)自动扫描装入spring容器; 从容器中取出类的方法: (1)通过配置文件产生BeanFactory或ApplicationContext对象进而取出类; (2)通过注解@AutoWired 阅读全文
posted @ 2020-10-28 10:37 一天从晚上开始 阅读(85) 评论(0) 推荐(0) 编辑
摘要: 一、配置单个Dao实现: mapper/productMapper.xml: <?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://myb 阅读全文
posted @ 2020-10-28 10:29 一天从晚上开始 阅读(95) 评论(0) 推荐(0) 编辑
摘要: myBatis一般执行过程: (1)String resource = "myBatis-config.xml";(2)Reader reader = Resources.getResourceAsReader(resource);(3)sqlSessionFactory = new SqlSess 阅读全文
posted @ 2020-10-28 10:11 一天从晚上开始 阅读(94) 评论(0) 推荐(0) 编辑
摘要: <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 阅读全文
posted @ 2020-10-28 09:58 一天从晚上开始 阅读(384) 评论(0) 推荐(0) 编辑