質問編集履歴
2
テーブル画像添付いたしました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -587,3 +587,5 @@
|
|
587
587
|
}
|
588
588
|
|
589
589
|
```
|
590
|
+
|
591
|
+
![イメージ説明](c28105612d90d2068893810ae80a0cda.jpeg)
|
1
while文をコメントアウトしました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -537,3 +537,53 @@
|
|
537
537
|
HeidiSQL
|
538
538
|
|
539
539
|
eclipse NEON
|
540
|
+
|
541
|
+
```
|
542
|
+
|
543
|
+
新規登録不可DAO while文部分コメントアウトに修正
|
544
|
+
|
545
|
+
PreparedStatement st= con.prepareStatement("insert into customer values(null,?,?)");
|
546
|
+
|
547
|
+
st.setString(1, login);
|
548
|
+
|
549
|
+
st.setString(2, password);
|
550
|
+
|
551
|
+
ResultSet rs = st.executeQuery();
|
552
|
+
|
553
|
+
int line = st.executeUpdate();
|
554
|
+
|
555
|
+
|
556
|
+
|
557
|
+
//while(rs.next()){
|
558
|
+
|
559
|
+
customer = new Customer();
|
560
|
+
|
561
|
+
customer.setId(rs.getInt("id"));
|
562
|
+
|
563
|
+
customer.setLogin(rs.getString("login"));
|
564
|
+
|
565
|
+
customer.setPassword(rs.getString("password"));
|
566
|
+
|
567
|
+
//}
|
568
|
+
|
569
|
+
if(line > 0){
|
570
|
+
|
571
|
+
con.commit();
|
572
|
+
|
573
|
+
}else{
|
574
|
+
|
575
|
+
con.rollback();
|
576
|
+
|
577
|
+
}
|
578
|
+
|
579
|
+
st.close();
|
580
|
+
|
581
|
+
con.close();
|
582
|
+
|
583
|
+
return line;
|
584
|
+
|
585
|
+
}
|
586
|
+
|
587
|
+
}
|
588
|
+
|
589
|
+
```
|