第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

如何忽略 SQL 更新中的列

如何忽略 SQL 更新中的列

紫衣仙女 2021-10-17 11:01:13
我有一個(gè)程序可以查看用戶模型,如果它們不為空,則將值添加到準(zhǔn)備好的更新語句中,如下所示    PreparedStatement pst = conn.prepareStatement("UPDATE users SET name=?,email=?,pwd=?,avatar=?,sts=?,bio=?,country=? WHERE uuid=?");    if(this.name != null) pst.setString(1, this.name);    if(this.email != null) pst.setString(2, this.email);    if(this.password != null) pst.setString(3, this.password);    if(this.avatar != null) pst.setString(4, this.avatar);    if(this.status != null) pst.setString(5, this.status);    if(this.bio != null) pst.setString(6, this.bio);    if(this.country != null) pst.setString(7, this.country);    pst.setString(6, this.id);我面臨的問題是準(zhǔn)備好的語句中不能有未定義的字段。我可以將不想更改的字段設(shè)置為等于什么?
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 111 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)