op_department.java

来自「考勤管理系统是针对学校每个月的考勤的报表进行总结」· Java 代码 · 共 41 行

JAVA
41
字号
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 + =
减小字号Ctrl + -
显示快捷键?