📄 teststudentstore.java
字号:
/**
* 这是StudentStore类、DBConnection类、QueryTableStore类的测试程序
*/
import java.sql.Connection;
import java.util.HashMap;
public class TestStudentStore
{
public static void main(String[] args)
{
DBConnection dbCon = new DBConnection();
Connection con = dbCon.getConnection();
QueryTableStore query = new QueryTableStore();
HashMap map = query.getStudent(con);
StudentStore store = (StudentStore)map.get("student");
System.out.println("当前StudentStore中元素的个数为=" + store.size());
for(int i = 0; i < store.size(); i++)
{
String name = store.getStudentName(i);
String number = store.getStudentNumber(i);
String sex = store.getStudentSex(i);
String spec = store.getStudentSpeciality(i);
System.out.println("姓名=" + name + "\t学号=" + number +
"\t性别=" + sex + "\t专业=" + spec);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -