菜鸟每天一练,只为更好的明天!简单勿喷!
思路:
1.定义员工类
2.定义一个集合用来装载对象的
3.循环查询员工表的每一行数据,创建员工对象,加入集合
4.for each 遍历集合打印
#员工类
package cn.itcast.jdbc;
import java.util.Date;
public class employeeClass
{
int id;
String name;
int age;
int dep_id;
double salary;
Date join_date;
public employeeClass(int id, String name, int age, int dep_id, double salary, Date join_date) {
this.id = id;
this.name = name;
this.age = age;
this.dep_id = dep_id;
this.salary = salary;
this.join_date = join_date;
}
public employeeClass() {
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name =