⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classinfo.java

📁 培训考试系统代码
💻 JAVA
字号:
package com.huawei.icd30.agt.util;

import java.util.Map;
import java.util.HashMap;
import com.huawei.icd30.common.db.*;

/**
 *
 * <p> 本类的功能描述信息</p>
 * <p> (这家伙很懒,什么都没有写)</p>
 * <p> </p>
 * <p> </p>
 * @author 高阳
 * @version 1.0
 */
public class ClassInfo
{
    private static Map  map  = null;

    /**
     * 系统启动时候调用,测试改成静态块
     */
    static
    {

        map                = new HashMap();
        SysConnPool cspool = null;
        SysDbConn con      = null;
        try
        {
            cspool = SysConnPool.getInstance();
            con    = cspool.getAplComs();
            con.preparedQuery("");
            SysResultSet res = con.csCommonQuery("SQL_AGT_CLSMNGALL","1","-1").getResultSet();
            while( res.next() )
            {
                map.put(res.getString("CLASSID").trim(),res.getString("CLASSTITLE").trim());
            }
        }
        catch(SysDbException e)
        {
            e.printStackTrace();
        }
        catch(java.sql.SQLException e)
        {
            e.printStackTrace();
        }
        finally
        {
            con.close();
        }
    }

    /**
     * 取得信息
     * @param key
     * @return
     */
    public static String get(String key)
    {
        Object value =map.get(key.trim());
        return value==null?null:(String)value;
    }

    /**
     *更新类别信息
     */
    public static void updateInfo()
    {
        SysConnPool cspool = null;
        SysDbConn con      = null;
        map.clear();
        try
        {
            cspool = SysConnPool.getInstance();
            con    = cspool.getAplComs();
            con.preparedQuery("");
            SysResultSet res = con.csCommonQuery("SQL_AGT_CLSMNGALL","1","-1").getResultSet();
            while( res.next() )
            {
                map.put(res.getString("CLASSID").trim(),res.getString("CLASSTITLE").trim());
            }
        }
        catch(SysDbException e)
        {
            e.printStackTrace();
        }
        catch(java.sql.SQLException e)
        {
            e.printStackTrace();
        }
        finally
        {
            con.close();
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -