Пример #1
0
  /**
   * ���׿� �α׸� ��� �Ѵ�.
   *
   * @param log
   */
  public static void debugLog(String log) {

    String[] arrEncode = getValue("logDecode").split("\\>");
    try {
      ReadPropertiesAble rp = ReadProperties.getInstance();
      if (rp.getValue("debugLog").equals("Y")) {

        String path = rp.getValue("debugLogPath");
        if (path == null || path.equals("")) path = rp.getPath();
        log = (arrEncode.length == 2) ? new String(log.getBytes(arrEncode[0]), arrEncode[1]) : log;
        // System.out.println(Log.getInstance().logDate()+" : "+log);
        Log.getInstance().println(path + "degug.log", log);
      }

    } catch (Exception e) {
    }
  }
Пример #2
0
  public static void accessMwLog(String log) {

    String[] arrEncode = getValue("logDecode").split("\\>");
    try {
      ReadPropertiesAble rp = ReadProperties.getInstance();
      if (rp.getValue("accessMwLog").equals("Y")) {

        Calendar cal = Calendar.getInstance();
        SimpleDateFormat sdf = new SimpleDateFormat();
        sdf.applyPattern("yyyy-MM-dd");
        String path = rp.getValue("accessMwLogPath");
        if (path == null || path.equals("")) path = rp.getPath();
        log = (arrEncode.length == 2) ? new String(log.getBytes(arrEncode[0]), arrEncode[1]) : log;
        // System.out.println(Log.getInstance().logDate()+" : "+log);
        Log.getInstance()
            .println(path + "access_mw_" + sdf.format(cal.getTime()).toString() + ".log", log);
      }

    } catch (Exception e) {
    }
  }
Пример #3
0
  /**
   * DB Connection ��ü�� ��ȯ�Ѵ�.
   *
   * @return
   */
  public static Connection getDB(String key) {

    ReadPropertiesAble rp = ReadProperties.getInstance();
    Connection conn = null;

    try {

      if (rp.getValue("was").equals("weblogic")) {

        try {
          conn = ConnectionFactory.getInstance().getConnectionWeblogic(rp.getValue(key));
        } catch (Exception e) {
          errorLog("weblogic DB ���ῡ�� :" + e.toString());
        }

      } else if (rp.getValue("was").equals("tomcat")) {

        try {
          conn =
              ConnectionFactory.getInstance()
                  .getConnectionTomcat(rp.getValue("JNDI"), rp.getValue(key));
          conn.setAutoCommit(true);

        } catch (Exception e) {
          errorLog("tomcat DB ���ῡ�� :" + e.toString());
        }
      }

    } catch (Exception e) {
      errorLog("��d���� ���� ���� :" + e.toString());
    }

    return conn;
  }