/**
   * resource data
   *
   * @param userDBResource
   * @param contents
   * @throws Exception
   */
  private static void insertResourceData(ExecutedSqlResourceDAO userDBResource, String contents)
      throws Exception {
    SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleSystemInitializer.getUserDB());

    // content data를 저장합니다.
    ExecutedSqlResourceDataDAO dataDao = new ExecutedSqlResourceDataDAO();
    dataDao.setExecuted_sql_resource_seq(userDBResource.getSeq());
    String[] arrayContent = SQLUtil.makeResourceDataArays(contents);
    for (String content : arrayContent) {
      dataDao.setDatas(content);
      sqlClient.insert("userExecuteSQLResourceDataInsert", dataDao); // $NON-NLS-1$			
    }
  }
  /**
   * save sqlhistory
   *
   * @param user_seq
   * @param userDB
   * @param sqlType
   * @param sqlHistoryDAO
   */
  public static void saveExecuteSQUeryResource(
      int user_seq,
      UserDBDAO userDB,
      PublicTadpoleDefine.EXECUTE_SQL_TYPE sqlType,
      SQLHistoryDAO sqlHistoryDAO)
      throws Exception {
    if (PublicTadpoleDefine.YES_NO.YES.name().equals(userDB.getIs_profile())) {
      ExecutedSqlResourceDAO executeSQLResourceDao = new ExecutedSqlResourceDAO();
      executeSQLResourceDao.setDb_seq(userDB.getSeq());
      executeSQLResourceDao.setUser_seq(user_seq);
      executeSQLResourceDao.setTypes(sqlType.toString());

      executeSQLResourceDao.setStartDateExecute(sqlHistoryDAO.getStartDateExecute());
      executeSQLResourceDao.setEndDateExecute(sqlHistoryDAO.getEndDateExecute());
      long duration =
          sqlHistoryDAO.getEndDateExecute().getTime()
              - sqlHistoryDAO.getStartDateExecute().getTime();
      executeSQLResourceDao.setDuration(Integer.parseInt("" + duration));

      executeSQLResourceDao.setRow(sqlHistoryDAO.getRows());
      executeSQLResourceDao.setResult(sqlHistoryDAO.getResult());
      executeSQLResourceDao.setMessage(
          sqlHistoryDAO
              .getMesssage()); // ""+(sqlHistoryDAO.getEndDateExecute().getTime() -
                               // sqlHistoryDAO.getStartDateExecute().getTime()));
      executeSQLResourceDao.setIpAddress(sqlHistoryDAO.getIpAddress());
      // 기존에 등록 되어 있는지 검사한다
      SqlMapClient sqlClient = TadpoleSQLManager.getInstance(TadpoleSystemInitializer.getUserDB());
      ExecutedSqlResourceDAO executeSQL =
          (ExecutedSqlResourceDAO)
              sqlClient.insert(
                  "userExecuteSQLResourceInsert", executeSQLResourceDao); // $NON-NLS-1$

      insertResourceData(executeSQL, sqlHistoryDAO.getStrSQLText());
    }
  }