您的位置:首页 > 数据库

查询数据库的 sql语句 返回字段 和类 属性的关系

2016-04-23 18:40 661 查看
数据库的数据表



实体类

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 = ?";


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: