📄 kchbj.java
字号:
package com.comingnet.bean;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import com.db.DBOperator;
public class KchBj {
ArrayList list=null;
ArrayList list0=null;
ArrayList list1=null;
ArrayList list2=null;
DBOperator dbop=new DBOperator();
public List Kechen(int xxbh){//返回课程链表
try {
System.out.println("select kcid,kcmc from m_currm where xxbh="+xxbh);
list=dbop.ExecuteSelect(false,"select kcid,kcmc from m_currm where xxbh="+xxbh);
} catch (NullPointerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
List<HashMap> newlist = new ArrayList<HashMap>();
for(int i=0;i<list.size();i++){
list0=(ArrayList)list.get(i);
HashMap<String, Comparable> bj = new HashMap<String, Comparable>();
bj.put("id",new Integer(list0.get(0).toString()));
bj.put("name",list0.get(1).toString());
newlist.add(bj) ;
}
return newlist;
}
public List Banji(int xxbh){//返回班级链表
try {
list1=dbop.ExecuteSelect(false,"select bjid,bjmc from m_class where xxbh="+xxbh);
} catch (NullPointerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
List<HashMap> newlist1 = new ArrayList<HashMap>();
for(int i=0;i<list1.size();i++){
list2=(ArrayList)list1.get(i);
HashMap<String, Comparable> bd = new HashMap<String, Comparable>();
bd.put("id",new Integer(list2.get(0).toString()));
bd.put("name",list2.get(1).toString());
newlist1.add(bd) ;
}
return newlist1;
}
public List teacher(int xxbh){//返回班级链表
try {
list1=dbop.ExecuteSelect(false,"select jsid,jsxm from m_teacher where xxbh="+xxbh);
} catch (NullPointerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
List<HashMap> newlist1 = new ArrayList<HashMap>();
for(int i=0;i<list1.size();i++){
list2=(ArrayList)list1.get(i);
HashMap<String, Comparable> bd = new HashMap<String, Comparable>();
bd.put("id",new Integer(list2.get(0).toString()));
bd.put("name",list2.get(1).toString());
newlist1.add(bd) ;
}
return newlist1;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -