示例#1
0
  /**
   * Update NTP_ADM_CONF Data Bindding JavaBean
   *
   * @param bean NTP_ADM_CONF Data Bindding JavaBean
   * @return 更新件数
   * @throws SQLException SQL実行例外
   */
  public int update(NtpAdmConfModel bean) throws SQLException {

    PreparedStatement pstmt = null;
    int count = 0;
    Connection con = null;
    con = getCon();

    try {
      // SQL文
      SqlBuffer sql = new SqlBuffer();
      sql.addSql(" update");
      sql.addSql("   NTP_ADM_CONF");
      sql.addSql(" set ");
      sql.addSql("   NAC_CRANGE=?,");
      sql.addSql("   NAC_ATDEL_FLG=?,");
      sql.addSql("   NAC_ATDEL_Y=?,");
      sql.addSql("   NAC_ATDEL_M=?,");
      sql.addSql("   NAC_HOUR_DIV=?,");
      sql.addSql("   NAC_SML_KBN=?,");
      sql.addSql("   NAC_SML_NOTICE_KBN=?,");
      sql.addSql("   NAC_SML_NOTICE_GRP=?,");
      sql.addSql("   NAC_CSML_KBN=?,");
      sql.addSql("   NAC_CSML_NOTICE_KBN=?,");
      sql.addSql("   NAC_GSML_KBN=?,");
      sql.addSql("   NAC_GSML_NOTICE_KBN=?,");
      sql.addSql("   NAC_AUID=?,");
      sql.addSql("   NAC_ADATE=?,");
      sql.addSql("   NAC_EUID=?,");
      sql.addSql("   NAC_EDATE=?");

      pstmt = con.prepareStatement(sql.toSqlString());
      sql.addIntValue(bean.getNacCrange());
      sql.addIntValue(bean.getNacAtdelFlg());
      sql.addIntValue(bean.getNacAtdelY());
      sql.addIntValue(bean.getNacAtdelM());
      sql.addIntValue(bean.getNacHourDiv());
      sql.addIntValue(bean.getNacSmlKbn());
      sql.addIntValue(bean.getNacSmlNoticeKbn());
      sql.addIntValue(bean.getNacSmlNoticeGrp());
      sql.addIntValue(bean.getNacCsmlKbn());
      sql.addIntValue(bean.getNacCsmlNoticeKbn());
      sql.addIntValue(bean.getNacGsmlKbn());
      sql.addIntValue(bean.getNacGsmlNoticeKbn());
      sql.addIntValue(bean.getNacAuid());
      sql.addDateValue(bean.getNacAdate());
      sql.addIntValue(bean.getNacEuid());
      sql.addDateValue(bean.getNacEdate());

      log__.info(sql.toLogString());
      sql.setParameter(pstmt);
      count = pstmt.executeUpdate();
    } catch (SQLException e) {
      throw e;
    } finally {
      JDBCUtil.closeStatement(pstmt);
    }
    return count;
  }
示例#2
0
  /**
   * Insert NTP_ADM_CONF Data Bindding JavaBean
   *
   * @param bean NTP_ADM_CONF Data Bindding JavaBean
   * @throws SQLException SQL実行例外
   */
  public void insert(NtpAdmConfModel 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(" NTP_ADM_CONF(");
      sql.addSql("   NAC_CRANGE,");
      sql.addSql("   NAC_ATDEL_FLG,");
      sql.addSql("   NAC_ATDEL_Y,");
      sql.addSql("   NAC_ATDEL_M,");
      sql.addSql("   NAC_HOUR_DIV,");
      sql.addSql("   NAC_SML_KBN,");
      sql.addSql("   NAC_SML_NOTICE_KBN,");
      sql.addSql("   NAC_SML_NOTICE_GRP,");
      sql.addSql("   NAC_CSML_KBN,");
      sql.addSql("   NAC_CSML_NOTICE_KBN,");
      sql.addSql("   NAC_GSML_KBN,");
      sql.addSql("   NAC_GSML_NOTICE_KBN,");
      sql.addSql("   NAC_AUID,");
      sql.addSql("   NAC_ADATE,");
      sql.addSql("   NAC_EUID,");
      sql.addSql("   NAC_EDATE");
      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(" )");

      pstmt = con.prepareStatement(sql.toSqlString());
      sql.addIntValue(bean.getNacCrange());
      sql.addIntValue(bean.getNacAtdelFlg());
      sql.addIntValue(bean.getNacAtdelY());
      sql.addIntValue(bean.getNacAtdelM());
      sql.addIntValue(bean.getNacHourDiv());
      sql.addIntValue(bean.getNacSmlKbn());
      sql.addIntValue(bean.getNacSmlNoticeKbn());
      sql.addIntValue(bean.getNacSmlNoticeGrp());
      sql.addIntValue(bean.getNacCsmlKbn());
      sql.addIntValue(bean.getNacCsmlNoticeKbn());
      sql.addIntValue(bean.getNacGsmlKbn());
      sql.addIntValue(bean.getNacGsmlNoticeKbn());
      sql.addIntValue(bean.getNacAuid());
      sql.addDateValue(bean.getNacAdate());
      sql.addIntValue(bean.getNacEuid());
      sql.addDateValue(bean.getNacEdate());
      log__.info(sql.toLogString());
      sql.setParameter(pstmt);
      pstmt.executeUpdate();
    } catch (SQLException e) {
      throw e;
    } finally {
      JDBCUtil.closeStatement(pstmt);
    }
  }