Search in sources :

Example 1 with IDL

use of beans.dbaccess.IDL in project MSEC by Tencent.

the class DelIDLTag method deleteAll.

public static String deleteAll(String flsn, String slsn) {
    DBUtil util = new DBUtil();
    if (util.getConnection() == null) {
        return "DB connect failed.";
    }
    try {
        String sql = "select tag_name from t_idl_tag where  first_level_service_name=? and second_level_service_name=?";
        List<Object> params = new ArrayList<Object>();
        params.add(flsn);
        params.add(slsn);
        ArrayList<IDL> result = util.findMoreRefResult(sql, params, IDL.class);
        for (int i = 0; i < result.size(); i++) {
            String tag_name = result.get(i).getTag_name();
            sql = "delete from t_idl_tag where tag_name=? and first_level_service_name=? and second_level_service_name=?";
            params = new ArrayList<Object>();
            params.add(tag_name);
            params.add(flsn);
            params.add(slsn);
            //删除数据库记录
            int delNum = util.updateByPreparedStatement(sql, params);
            String filename = IDL.getIDLFileName(flsn, slsn, tag_name);
            RemoveFile(filename);
        }
        return "success";
    } catch (Exception e) {
        e.printStackTrace();
        return e.getMessage();
    } finally {
        util.releaseConn();
    }
}
Also used : IDL(beans.dbaccess.IDL) DBUtil(ngse.org.DBUtil) ArrayList(java.util.ArrayList) SQLException(java.sql.SQLException)

Aggregations

IDL (beans.dbaccess.IDL)1 SQLException (java.sql.SQLException)1 ArrayList (java.util.ArrayList)1 DBUtil (ngse.org.DBUtil)1