📄 op_department.java
字号:
package action;
import java.sql.SQLException;
import java.util.Vector;
public class Op_department extends DBOption {
private Vector<String> deps = null;
private String sqlStr = "";
public String msg = "";
public Op_department() {
this.setPoolName("std");
}
/**
* 取得所有院系信息
* @return Vector 院系向量
*/
public Vector getAllDep() {
sqlStr = "select distinct SDEPART from students";
deps = new Vector<String>();
try {
this.rs = this.query(sqlStr);
while (rs.next()) {
deps.addElement(rs.getString("SDEPART").trim());
}
rs.close();
return this.deps;
} catch (SQLException e) {
this.msg = "查询时出错,请稍微再试!";
Log.writeLog(e, "action.Op_department." +
"getAllDep:\n\t查询失败!");
return null;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -