上一页 1 2 3 4 5 6 7 8 9 ··· 23 下一页
摘要: 03_6_package和import语句 1. package和import语句 为便于管理大型软件系统中数目众多的类,解决类的命名冲突问题,Java引入包(package)机制,提供类的多重命名空间。 package语句作为Java源文件的第一条语句,指明该文件中定义的类所在的包。(若缺省该语句 阅读全文
posted @ 2018-03-30 23:48 FlyBack 阅读(287) 评论(0) 推荐(0) 编辑
摘要: 03_5_static关键字 1. static关键字 在类中,用static声明的成员变量为静态成员变量,它为该类的公用 变量,在第一次使用时被初始化,对于该类的所有对象来说,static成员变量只有一份。 用static声明的方法为静态方法,在调用该方法时,不会将对象的引用传递给它,所以在sta 阅读全文
posted @ 2018-03-30 21:43 FlyBack 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 01_8_sql主键生成方式 1. 配置映射文件 <insert id="insertStudentBySequence" parameterClass="Student"> <selectKey resultClass="int" keyProperty="sid"> select student 阅读全文
posted @ 2018-03-28 23:13 FlyBack 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 01_7_模糊查询实体对象 1. 配置映射文件 <select id="selectStudentByName" parameterClass="String" resultClass="Student"> select * from Student where name like '%$name$ 阅读全文
posted @ 2018-03-28 21:39 FlyBack 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 01_6_修改实体对象 1. 配置相应的映射文件 <update id="updateStudentById" parameterClass="Student"> update student set name=#name#, major=#major#, score=#score#, birth= 阅读全文
posted @ 2018-03-28 07:14 FlyBack 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 01_5_删除指定id的单个对象 1. 配置相应的映射文件内容 <delete id="deleteStudent" parameterClass="int"> delete from student where sid=#sid# </delete> 2. 实现类的方法 public void d 阅读全文
posted @ 2018-03-28 06:40 FlyBack 阅读(352) 评论(0) 推荐(0) 编辑
摘要: 01_4_插入一个实体对象 1. 配置映射配置 <insert id="insertStudent" parameterClass="Student"> insert into Student(sid, name, major, birth, score) values(#sid#, #name#, 阅读全文
posted @ 2018-03-27 21:56 FlyBack 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 01_3_查询指定id的单个对象 1. 映射文件配置如下信息 <select id="selectStudentById" resultClass="Student" parameterClass="int"> select sid, name, major, birth, score from s 阅读全文
posted @ 2018-03-27 21:18 FlyBack 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 01_2_查询所有的对象 1. 实体类 package entity; import java.util.Date; public class Student { private int sid = 0; private String name = null; private String majo 阅读全文
posted @ 2018-03-27 20:25 FlyBack 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 01_1_准备ibatis环境 1. 搭建环境:导入相关的jar包 mysql-connector-java-5.1.5-bin.jar(mysql)或者ojdbc6.jar(oracle)、ibatis-2.3.3.720.jar 2. 配置文件 2.1jdbc连接的属性文件 SqlMap.pro 阅读全文
posted @ 2018-03-27 20:19 FlyBack 阅读(121) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 23 下一页