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

為了賬號(hào)安全,請及時(shí)綁定郵箱和手機(jī)立即綁定

在更新模塊中,如何不需要更新的字段,該如何處理

在更新模塊中,如何不需要更新的字段,該如何處理

正在回答

3 回答

/*
			?*?功能5:更新女神信息
			?*/
			else?if(OPERATION_UPDATE.equals(input.toUpperCase())
					||OPERATION_UPDATE.substring(0,1).equals(input.toUpperCase())
					||OPERATION_UPDATE.equals(previous)){
				previous=OPERATION_UPDATE;
				if(step==1){
					System.out.println("請輸入要更新的女神編號(hào)");
				}
				
				if(step==2){
					Integer?id=null;
					//第一個(gè)try是防止用戶輸入非數(shù)字id
					try?{
						id=Integer.valueOf(input);
						goddess=action.get(id);
						if(goddess==null){
							System.out.println("查詢女信息失敗,請輸入正確的女神id");
							step=1;
						}
						else{
							System.out.println("姓名(如果不更新該字段,請輸入null):");
						}
					}?catch?(Exception?e)?{
						System.out.println("請輸入正確的女神id");
						step=1;
					}
				}
				
				if(step==3){
					if(!input.equals("null")){
						goddess.setUser_name(input);
					}
					System.out.println("年齡:");
				}
				//輸入年齡,提示輸入生日
				if(step==4){
						Integer?age=null;
						try?{
							if(!input.equals("null")){
							age=Integer.valueOf(input);
							goddess.setAge(age);
							}
							System.out.println("生日?,格式:yyyy-MM-dd");
						}?catch?(Exception?e)?{
							System.out.println("請輸入正確的女神年齡:");
							step=3;
						}
				}
				//輸入生日
				if(step==5){
						SimpleDateFormat?sdf=new?SimpleDateFormat("yyyy-MM-dd");
						Date?birthday=null;
						try?{
							if(!input.equals("null")){
							birthday?=?sdf.parse(input);
							goddess.setBirthday(birthday);
							}
							System.out.println("郵箱:");
						}?catch?(ParseException?e)?{
							System.out.println("您輸入的格式有誤,請重新輸入");
							step=4;
						}
				}
				
				if(step==6){
					if(!input.equals("null")){
						goddess.setEmail(input);
					}
					System.out.println("手機(jī)號(hào):");
				}
				if(step==7){
					if(!input.equals("null")){
						goddess.setMobile(input);
					}
					try?{
						action.edit(goddess);
						System.out.println("女神信息更新成功");
					}?catch?(Exception?e)?{
						System.out.println("女神信息更新失敗");
					}
					step=1;
					previous=null;
				}
				if(OPERATION_UPDATE.equals(previous)){
					step++;
				}


1 回復(fù) 有任何疑惑可以回復(fù)我~

/*

* 功能5:更新女神信息

*/

else if(OPERATION_UPDATE.equals(input.toUpperCase())

||OPERATION_UPDATE.substring(0,1).equals(input.toUpperCase())

||OPERATION_UPDATE.equals(previous)){

previous=OPERATION_UPDATE;

if(step==1){

System.out.println("請輸入要更新的女神編號(hào)");

}

if(step==2){

Integer id=null;

//第一個(gè)try是防止用戶輸入非數(shù)字id

try {

id=Integer.valueOf(input);

goddess=action.get(id);

if(goddess==null){

System.out.println("查詢女信息失敗,請輸入正確的女神id");

step=1;

}

else{

System.out.println("姓名(如果不更新該字段,請輸入null):");

}

} catch (Exception e) {

System.out.println("請輸入正確的女神id");

step=1;

}

}

if(step==3){

if(!input.equals("null")){

goddess.setUser_name(input);

}

System.out.println("年齡:");

}

//輸入年齡,提示輸入生日

if(step==4){

Integer age=null;

try {

if(!input.equals("null")){

age=Integer.valueOf(input);

goddess.setAge(age);

}

System.out.println("生日 ,格式:yyyy-MM-dd");

} catch (Exception e) {

System.out.println("請輸入正確的女神年齡:");

step=3;

}

}

//輸入生日

if(step==5){

SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");

Date birthday=null;

try {

if(!input.equals("null")){

birthday = sdf.parse(input);

goddess.setBirthday(birthday);

}

System.out.println("郵箱:");

} catch (ParseException e) {

System.out.println("您輸入的格式有誤,請重新輸入");

step=4;

}

}

if(step==6){

if(!input.equals("null")){

goddess.setEmail(input);

}

System.out.println("手機(jī)號(hào):");

}

if(step==7){

if(!input.equals("null")){

goddess.setMobile(input);

}

try {

action.edit(goddess);

System.out.println("女神信息更新成功");

} catch (Exception e) {

System.out.println("女神信息更新失敗");

}

step=1;

previous=null;

}

if(OPERATION_UPDATE.equals(previous)){

step++;

}


0 回復(fù) 有任何疑惑可以回復(fù)我~

通過將數(shù)據(jù)庫中對應(yīng)id?的數(shù)據(jù)取出來,賦值給不需要更新的字段

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
JDBC之 “ 對岸的女孩看過來”
  • 參與學(xué)習(xí)       99327    人
  • 解答問題       903    個(gè)

一起領(lǐng)略JDBC的奧秘,為進(jìn)一步學(xué)習(xí)集成框架打下良好的基礎(chǔ)

進(jìn)入課程

在更新模塊中,如何不需要更新的字段,該如何處理

我要回答 關(guān)注問題
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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