Пример #1
0
  /**
   * アカウント設定を更新する
   *
   * @param bean WML_ADM_CONF Data Bindding JavaBean
   * @return 更新件数
   * @throws SQLException SQL実行例外
   */
  public int updateAdmConf(WmlAdmConfModel bean) throws SQLException {

    PreparedStatement pstmt = null;
    int count = 0;
    Connection con = null;
    con = getCon();
    boolean receiveUpFlg = bean.getWadAutoreceive() == GSConstWebmail.MAIL_AUTO_RSV_ON;

    try {
      // SQL文
      SqlBuffer sql = new SqlBuffer();
      sql.addSql(" update");
      sql.addSql("   WML_ADM_CONF");
      sql.addSql(" set ");
      sql.addSql("   WAD_ACNT_MAKE=?,");
      sql.addSql("   WAD_ACCT_SENDFORMAT=?,");
      sql.addSql("   WAD_ACCT_LOG_REGIST=?,");
      sql.addSql("   WAD_PERMIT_KBN=?,");
      if (receiveUpFlg) {
        sql.addSql("   WAD_AUTO_RECEIVE_TIME=?,");
      }
      sql.addSql("   WAD_DISK=?,");
      sql.addSql("   WAD_DISK_SIZE=?,");
      sql.addSql("   WAD_DISK_COMP=?,");
      sql.addSql("   WAD_DELRECEIVE=?,");
      sql.addSql("   WAD_AUTORECEIVE=?,");
      sql.addSql("   WAD_SEND_HOST=?,");
      sql.addSql("   WAD_SEND_PORT=?,");
      sql.addSql("   WAD_SEND_SSL=?,");
      sql.addSql("   WAD_RECEIVE_HOST=?,");
      sql.addSql("   WAD_RECEIVE_PORT=?,");
      sql.addSql("   WAD_RECEIVE_SSL=?,");
      sql.addSql("   WAD_CHECK_ADDRESS=?,");
      sql.addSql("   WAD_CHECK_FILE=?,");
      sql.addSql("   WAD_COMPRESS_FILE=?,");
      sql.addSql("   WAD_TIMESENT=?,");
      sql.addSql("   WAD_SEND_LIMIT=?,");
      sql.addSql("   WAD_SEND_LIMIT_SIZE=?,");
      sql.addSql("   WAD_FWLIMIT=?,");
      sql.addSql("   WAD_BCC=?,");
      sql.addSql("   WAD_BCC_TH=?,");
      sql.addSql("   WAD_WARN_DISK=?,");
      sql.addSql("   WAD_WARN_DISK_TH=?,");
      sql.addSql("   WAD_SETTING_SERVER=?,");
      sql.addSql("   WAD_PROXY_USER=?,");
      sql.addSql("   WAD_COMPRESS_FILE_DEF=?,");
      sql.addSql("   WAD_TIMESENT_DEF=?");

      pstmt = con.prepareStatement(sql.toSqlString());
      sql.addIntValue(bean.getWadAcntMake());
      sql.addIntValue(bean.getWadAcctSendformat());
      sql.addIntValue(bean.getWadAcctLogRegist());
      sql.addIntValue(bean.getWadPermitKbn());
      if (receiveUpFlg) {
        sql.addIntValue(bean.getWadAutoReceiveTime());
      }
      sql.addIntValue(bean.getWadDisk());
      sql.addIntValue(bean.getWadDiskSize());
      sql.addIntValue(bean.getWadDiskComp());
      sql.addIntValue(bean.getWadDelreceive());
      sql.addIntValue(bean.getWadAutoreceive());
      sql.addStrValue(bean.getWadSendHost());
      sql.addIntValue(bean.getWadSendPort());
      sql.addIntValue(bean.getWadSendSsl());
      sql.addStrValue(bean.getWadReceiveHost());
      sql.addIntValue(bean.getWadReceivePort());
      sql.addIntValue(bean.getWadReceiveSsl());
      sql.addIntValue(bean.getWadCheckAddress());
      sql.addIntValue(bean.getWadCheckFile());
      sql.addIntValue(bean.getWadCompressFile());
      sql.addIntValue(bean.getWadTimesent());
      sql.addIntValue(bean.getWadSendLimit());
      sql.addIntValue(bean.getWadSendLimitSize());
      sql.addIntValue(bean.getWadFwlimit());
      sql.addIntValue(bean.getWadBcc());
      sql.addIntValue(bean.getWadBccTh());
      sql.addIntValue(bean.getWadWarnDisk());
      sql.addIntValue(bean.getWadWarnDiskTh());
      sql.addIntValue(bean.getWadSettingServer());
      sql.addIntValue(bean.getWadProxyUser());
      sql.addIntValue(bean.getWadCompressFileDef());
      sql.addIntValue(bean.getWadTimesentDef());

      log__.info(sql.toLogString());
      sql.setParameter(pstmt);
      count = pstmt.executeUpdate();
    } catch (SQLException e) {
      throw e;
    } finally {
      JDBCUtil.closeStatement(pstmt);
    }
    return count;
  }
Пример #2
0
  /**
   * Insert WML_ADM_CONF Data Bindding JavaBean
   *
   * @param bean WML_ADM_CONF Data Bindding JavaBean
   * @throws SQLException SQL実行例外
   */
  public void insert(WmlAdmConfModel bean) throws SQLException {

    PreparedStatement pstmt = null;
    Connection con = null;
    con = getCon();

    try {
      // SQL文
      SqlBuffer sql = new SqlBuffer();
      sql.addSql(" insert ");
      sql.addSql(" into ");
      sql.addSql(" WML_ADM_CONF(");
      sql.addSql("   WAD_ACNT_MAKE,");
      sql.addSql("   WAD_ACCT_SENDFORMAT,");
      sql.addSql("   WAD_ACCT_LOG_REGIST,");
      sql.addSql("   WAD_PERMIT_KBN,");
      sql.addSql("   WAD_AUTO_RECEIVE_TIME,");
      sql.addSql("   WAD_DISK,");
      sql.addSql("   WAD_DISK_SIZE,");
      sql.addSql("   WAD_DISK_COMP,");
      sql.addSql("   WAD_DELRECEIVE,");
      sql.addSql("   WAD_AUTORECEIVE,");
      sql.addSql("   WAD_SEND_HOST,");
      sql.addSql("   WAD_SEND_PORT,");
      sql.addSql("   WAD_SEND_SSL,");
      sql.addSql("   WAD_RECEIVE_HOST,");
      sql.addSql("   WAD_RECEIVE_PORT,");
      sql.addSql("   WAD_RECEIVE_SSL,");
      sql.addSql("   WAD_CHECK_ADDRESS,");
      sql.addSql("   WAD_CHECK_FILE,");
      sql.addSql("   WAD_COMPRESS_FILE,");
      sql.addSql("   WAD_TIMESENT,");
      sql.addSql("   WAD_SEND_LIMIT,");
      sql.addSql("   WAD_SEND_LIMIT_SIZE,");
      sql.addSql("   WAD_FWLIMIT,");
      sql.addSql("   WAD_BCC,");
      sql.addSql("   WAD_BCC_TH,");
      sql.addSql("   WAD_WARN_DISK,");
      sql.addSql("   WAD_WARN_DISK_TH,");
      sql.addSql("   WAD_SETTING_SERVER,");
      sql.addSql("   WAD_PROXY_USER,");
      sql.addSql("   WAD_COMPRESS_FILE_DEF,");
      sql.addSql("   WAD_TIMESENT_DEF");
      sql.addSql(" )");
      sql.addSql(" values");
      sql.addSql(" (");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?,");
      sql.addSql("   ?");
      sql.addSql(" )");

      pstmt = con.prepareStatement(sql.toSqlString());
      sql.addIntValue(bean.getWadAcntMake());
      sql.addIntValue(bean.getWadAcctSendformat());
      sql.addIntValue(bean.getWadAcctLogRegist());
      sql.addIntValue(bean.getWadPermitKbn());
      sql.addIntValue(bean.getWadAutoReceiveTime());
      sql.addIntValue(bean.getWadDisk());
      sql.addIntValue(bean.getWadDiskSize());
      sql.addIntValue(bean.getWadDiskComp());
      sql.addIntValue(bean.getWadDelreceive());
      sql.addIntValue(bean.getWadAutoreceive());
      sql.addStrValue(bean.getWadSendHost());
      sql.addIntValue(bean.getWadSendPort());
      sql.addIntValue(bean.getWadSendSsl());
      sql.addStrValue(bean.getWadReceiveHost());
      sql.addIntValue(bean.getWadReceivePort());
      sql.addIntValue(bean.getWadReceiveSsl());
      sql.addIntValue(bean.getWadCheckAddress());
      sql.addIntValue(bean.getWadCheckFile());
      sql.addIntValue(bean.getWadCompressFile());
      sql.addIntValue(bean.getWadTimesent());
      sql.addIntValue(bean.getWadSendLimit());
      sql.addIntValue(bean.getWadSendLimitSize());
      sql.addIntValue(bean.getWadFwlimit());
      sql.addIntValue(bean.getWadBcc());
      sql.addIntValue(bean.getWadBccTh());
      sql.addIntValue(bean.getWadWarnDisk());
      sql.addIntValue(bean.getWadWarnDiskTh());
      sql.addIntValue(bean.getWadSettingServer());
      sql.addIntValue(bean.getWadProxyUser());
      sql.addIntValue(bean.getWadCompressFileDef());
      sql.addIntValue(bean.getWadTimesentDef());

      log__.info(sql.toLogString());
      sql.setParameter(pstmt);
      pstmt.executeUpdate();
    } catch (SQLException e) {
      throw e;
    } finally {
      JDBCUtil.closeStatement(pstmt);
    }
  }