发表于: 2017-08-10 22:58:46
1 887
今天完成的事
1 JDBC编写DAO,interfce和imple分离
先创建表
再写Person类
然后编写接口
创建工具类封装驱动和数据库链接
创建属性文件
写出Imple实现类
我们在各自的增删改查里都抛出了异常,如果出现异常,就会抛出相应的错误信息。
如果需要使用方法,直接调用就好了
初步配置Mybatis 尝试通过pom添加JAR包,开始学习理解Pom文件的作用和重要性
<!-- mybatis核心包 -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.3.0</version>
</dependency>
<!-- mysql驱动包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.29</version>
</dependency>
<!-- junit测试包 -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- 日志文件管理包 -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.12</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.12</version>
</dependency>
</dependencies>
明天的计划:收尾步骤17,完成mybatis相关,开始学习Spring
遇到的问题:编写实现类的时候部分代码出错,在使用网上代码的时候没有能够发现其代码错误,通过师兄排查之后解决
收获:今天初步认识了封装,以及配置文件的作用,能省很多工作,修改 配置文件就可以对不同数据库操作
任务进度:任务一步骤17
开始时间:2017-8-7
已延期,正按计划进行
http://task.ptteng.com/zentao/task-view-9060.html
评论