Taebu / prq_cdr

prq_cdr을 java 프로그램으로 구성합니다.
0 stars 0 forks source link

StringIndexOutOfBoundsException #9

Open Taebu opened 4 years ago

Taebu commented 4 years ago

WARNING: java.lang.StringIndexOutOfBoundsException: String index out of range: 6 at java.lang.String.substring(String.java:1963) at kr.co.cashq.safen_cdr.Safen_cmd_queue.is_salept(Safen_cmd_queue.java:1501) at kr.co.cashq.safen_cdr.Safen_cmd_queue.doMainProcess(Safen_cmd_queue.java:310) at kr.co.cashq.safen_cdr.SAFEN_CDR.doWork(SAFEN_CDR.java:238) at kr.co.cashq.safen_cdr.SAFEN_CDR.doMainProcess(SAFEN_CDR.java:78) at kr.co.cashq.safen_cdr.SAFEN_CDR.main(SAFEN_CDR.java:39)

Taebu commented 4 years ago

before

    /**
    * boolean is_salept
    * @param ed_type
    * @return boolean
    */
    private static boolean is_salept(String ed_type){
        boolean retVal=false;
            if(ed_type!=null){
                if(ed_type.length()>=5){
                    retVal = ed_type.substring(0,6).equals("salept");
                }else{
                    retVal = ed_type.equals("");
                }
            }
        return retVal;
    }
Taebu commented 4 years ago

after

    /**
    * boolean is_salept
    * @param ed_type
    * @return boolean
    */
    private static boolean is_salept(String ed_type){
        boolean retVal=false;
        try{
            if(ed_type!=null){
                if(ed_type.length()>=5){
                    retVal = ed_type.substring(0,6).equals("salept");
                }else{
                    retVal = ed_type.equals("");
                }
            }
        } catch (StringIndexOutOfBoundsException e) {
            Utils.getLogger().warning(e.getMessage());
            DBConn.latest_warning = "ErrPOS999";
            e.printStackTrace();
        }
        return retVal;
    }
Taebu commented 4 years ago

9월 05, 2020 8:26:16 오후 kr.co.cashq.safen_cdr.Safen_cmd_queue doMainProcess 경고: String index out of range: 6

Taebu commented 4 years ago

SELECT * FROM sktl.safen_cdr_202009 where conn_sdt='2020-09-05 20:26:16'

**** 1. row ***** seq: 10292955 conn_sdt: 2020-09-05 20:26:16 conn_edt: 2020-09-05 20:26:37 conn_sec: 21 service_sdt: 2020-09-05 20:26:22 service_edt: 2020-09-05 20:26:37 service_sec: 15 safen: 050704931642 safen_in: 0415317750 safen_out: 01067841821 billsec: 6 unique_id: 1939199273 account_cd: calllog_rec_file: 20200905202616_01067841821_050704931642_0415317750.mp3 rec_file_cd: 1 status_cd: 1 create_dt: 2020-09-05 20:28:24 1 rows in set

Taebu commented 4 years ago

elect * from cashq.store where tel='050704931642'; 없는 상점

Taebu commented 4 years ago

상점이 없었을 때의 예외 처리 필요

Taebu commented 4 years ago

image

Taebu commented 4 years ago

모두 처리 완료