/** * Insert SML_BAN_DEST_CONF Data Bindding JavaBean * * @param bean SML_BAN_DEST_CONF Data Bindding JavaBean * @throws SQLException SQL実行例外 */ public void insert(SmlBanDestConfModel 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(" SML_BAN_DEST_CONF("); sql.addSql(" SBC_SID,"); sql.addSql(" SBC_NAME,"); sql.addSql(" SBC_BIKO,"); sql.addSql(" SBC_AUID,"); sql.addSql(" SBC_ADATE,"); sql.addSql(" SBC_EUID,"); sql.addSql(" SBC_EDATE"); sql.addSql(" )"); sql.addSql(" values"); 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.getSbcSid()); sql.addStrValue(bean.getSbcName()); sql.addStrValue(bean.getSbcBiko()); sql.addIntValue(bean.getSbcAuid()); sql.addDateValue(bean.getSbcAdate()); sql.addIntValue(bean.getSbcEuid()); sql.addDateValue(bean.getSbcEdate()); log__.info(sql.toLogString()); sql.setParameter(pstmt); pstmt.executeUpdate(); } catch (SQLException e) { throw e; } finally { JDBCUtil.closeStatement(pstmt); } }
/** * Update SML_BAN_DEST_CONF Data Bindding JavaBean * * @param bean SML_BAN_DEST_CONF Data Bindding JavaBean * @return 更新件数 * @throws SQLException SQL実行例外 */ public int update(SmlBanDestConfModel 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(" SML_BAN_DEST_CONF"); sql.addSql(" set "); sql.addSql(" SBC_NAME=?,"); sql.addSql(" SBC_BIKO=?,"); sql.addSql(" SBC_AUID=?,"); sql.addSql(" SBC_ADATE=?,"); sql.addSql(" SBC_EUID=?,"); sql.addSql(" SBC_EDATE=?"); sql.addSql(" where "); sql.addSql(" SBC_SID=?"); pstmt = con.prepareStatement(sql.toSqlString()); sql.addStrValue(bean.getSbcName()); sql.addStrValue(bean.getSbcBiko()); sql.addIntValue(bean.getSbcAuid()); sql.addDateValue(bean.getSbcAdate()); sql.addIntValue(bean.getSbcEuid()); sql.addDateValue(bean.getSbcEdate()); // where sql.addIntValue(bean.getSbcSid()); log__.info(sql.toLogString()); sql.setParameter(pstmt); count = pstmt.executeUpdate(); } catch (SQLException e) { throw e; } finally { JDBCUtil.closeStatement(pstmt); } return count; }