Spring JDBC Author: HuiFer 源码阅读仓库: SourceHot-Spring 环境搭建 依赖 1 2 3 compile(project(":spring-jdbc")) compile group: 'com.alibaba', name: 'druid', version: '1.1.21' compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.47' db 配置 1 2 3 4 jdbc.url= jdbc.driverClass= jdbc.username= jdbc.password= 实体对象 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 public class HsLog { private Integer id; private String source; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getSource() { return source; } public void setSource(String source) { this.source = source; } } DAO 1 2 3 4 5 public interface HsLogDao { List<HsLog> findAll(); void save(HsLog hsLog); } 实现类 1 2 3 4 5 6……
阅读全文