Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
con = DriverManager.getConnection("jdbc:sqlserver://127.0.0.1:1433;DatabaseName=test", user, psw);
stmt2 = con.createStatement();
rs = stmt2.executeQuery(str);
ArrayList a = new ArrayList();
while(rs.next())
{
a.add(rs.getString(1));
}
jsh = new String[a.size()];
for(int i = 0; i < a.size(); i++)
{
jsh[i]= (String)a.get(i);
}
//ѡ���Ͽΰ༶
rs=stmt2.executeQuery("SELECT distinct bjm FROM course_list where xq='"+week+"' and js='"+js+"'");
ArrayList a1 = new ArrayList();
while(rs.next())
{
a1.add(rs.getString(1));
}
bjm = new String[a1.size()];
for(int i = 0; i < a1.size(); i++)
{
bjm[i]= (String)a1.get(i);
}
iii=a.size();
rs.close();
rs.close();
stmt2.close();
con.close();
}catch(SQLException e){
e.printStackTrace();
}
}else{
iii=0;
}
if(time>=480&&time<=710||time>=780&&time<=1200){ //8:00-11:50��13:00-20:00��������Ϊ0-70
for(int j=1;j<6;j++){ //i�������c����¥��j�����ѧ¥
for(int c=1;c<6;c++){
for(int i=1;i<11;i++){
String lh=Integer.toString(j);
String lc=Integer.toString(c);
if(i>9)
js1=Integer.toString(i);
else
js1="0"+Integer.toString(i);
lon=lh+lc+js1;
// System.out.print(lon+" ");
if(iii!=0){
int pan=0;
for(int k=0;k<iii;k++){
if(lon.equals(jsh[k])){//�������Ͽεİ༶����Ϊ��120�����ϿΣ��ܹ���������һ���ϣ�ÿ����63�ˣ�
try{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
con = DriverManager.getConnection("jdbc:sqlserver://127.0.0.1:1433;DatabaseName=test", user, psw);
stmt2 = con.createStatement();
//�����Ͽ�����
rs=null;
rs=stmt2.executeQuery("SELECT xh FROM [test].[dbo].[stu_info] where bjm='"+bjm[z].trim()+"' or bjm='"+bjm[z+1].trim()+"'");
ArrayList a2 = new ArrayList();
z=z+2;
while(rs.next())
{
a2.add(rs.getString(1));
}
renshu = a2.size()-6;
//System.out.println("a2="+a2.size());
Element title= document.createElement("Class_num");
root.appendChild(title);