Dep.java
上传用户:jishiqi_cj
上传日期:2022-08-08
资源大小:24765k
文件大小:1k
- package StudyNote;
- import java.util.*;
- import java.sql.Connection;
- import java.sql.ResultSet;
- public class Dep {
- private int id = 0;
- private String name = null;
-
- public Dep(){}
-
- public void setId(int id) {
- this.id = id;
- }
-
- public int getId() {
- return id;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
- public static Vector Search(DB db) throws Exception{
- Vector DepList = new Vector();
- ResultSet rs;
- String strSql=null;
- strSql = "select * from dep ";
-
- rs = db.OpenSql(strSql);
-
- while (rs.next()){
- Dep dep = new Dep();
-
- dep.setId(rs.getInt("id")) ;
- dep.setName(rs.getString("depname")) ;
-
- DepList.add(dep);
- }
- return DepList;
- }
-
- }