查询数据库的 sql语句 返回字段 和类 属性的关系
2016-04-23 18:40
661 查看
数据库的数据表
实体类
查询数据表的sql 语句
实体类
package exer; public class Student { //流水号 private int flowId; //考试的类型 private int type; //身份证号 private String idCard; //准考证号 private String examCard; //学生名 private String studentname; //学生地址 private String location; //考试成绩 private int grade; public Student() { super(); } public Student(int flowId, int type, String idCard, String examCard, String studentname, String location, int grade) { super(); this.flowId = flowId; this.type = type; this.idCard = idCard; this.examCard = examCard; this.studentname = studentname; this.location = location; this.grade = grade; } public int getFlowId() { return flowId; } public void setFlowId(int flowId) { this.flowId = flowId; } public int getType() { return type; } public void setType(int type) { this.type = type; } public String getIdCard() { return idCard; } public void setIdCard(String idCard) { this.idCard = idCard; } public String getExamCard() { return examCard; } public void setExamCard(String examCard) { this.examCard = examCard; } public String getStudentname() { return studentname; } public void setStudentname(String studentname) { this.studentname = studentname; } public String getLocation() { return location; } public void setLocation(String location) { this.location = location; } public int getGrade() { return grade; } public void setGrade(int grade) { this.grade = grade; } @Override public String toString() { return "Student [flowId=" + flowId + ", type=" + type + ", idCard=" + idCard + ", examCard=" + examCard + ", studentname=" + studentname + ", location=" + location + ", grade=" + grade + "]"; } }
查询数据表的sql 语句
String sql = "SELECT flow_id flowId,type,id_card idCard," + "exam_card examCard,student_name studentName," + "location,grade FROM examstudent WHERE flow_id = ?";
相关文章推荐
- Linux下PHP安装配置MongoDB
- Oracle中分页查询语句的写法
- 数据库 mysql 语句
- oracle trunc 函数处理日期格式,日期类型很有用的几个sql
- sql中游标的使用
- sql中游标的使用
- Linux下redis的安装
- Linux CentOS 7 下通过Memcached实现Session共享
- 《NoSQL入门》关于NoSQL
- oracle学习总结5(游标、触发器、过程、方法)
- 如何查一个字段在数据库的哪些表上
- mysql 使用中文
- mysql存储过程详解
- EF监听生成的所有sql语句(包括插入,删除sql)
- MySql的隔离级别和锁的关系
- mongodb分片配置
- JAVA redis 连接
- NHibernate重要概念的解释和说明
- 实验mongodb使用gridfs存放一个大文件
- 【Redis】一 CentOS 6.7 redis3 集群安装