- 博客(0)
- 资源 (1)
- 收藏
- 关注
daofactory
资源共享public class StudentOperate<InputData> implements PersonOperate{
private PersonDAO dao = null;
private InputData input = null;
public StudentOperate() {
this.dao = DAOFactory.getPersonDAOInstance("student.ser");
this.input = new InputData();
}
public void add() {
String id = new Timestamp("s").getTimestamp();
System.out.print("输入学生姓名:");
String name = this.input.getString();
System.out.print("输入学生年龄:");
int age = this.input.getInt();
System.out.print("输入学生成绩:");
float score = this.input.getFloat();
Student s = new Student(id, name, age, score);
try {
this.dao.doCreate(s);
} catch (Exception e) {
e.printStackTrace();
}
}
2014-12-24
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人