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

7 篇文章 0 订阅
6 篇文章 0 订阅

数据库的数据表


实体类

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


  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值