teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

?の個数をあわせました。

2021/06/12 03:06

投稿

junnokets
junnokets

スコア3

title CHANGED
File without changes
body CHANGED
@@ -1,6 +1,6 @@
1
1
  DBに値を追加できないです。
2
2
  下記のようにコードを打ち、フォームで値を入力すると
3
- SQLException:(conn=34) Could not set parameter at position 13 (values was ) Query - conn:34(M) - "insert into test values(?,?,?,?,?,?,?,?,?,?,?,?)"
3
+ SQLException:(conn=35) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '?,?,?,?,?,?,?,?,?,?,?,?,?,?)' at line 1 nullnullnullを登録しました。
4
4
  というエラーコードが出てしまいます。
5
5
 
6
6
  ```ここに言語を入力
@@ -73,7 +73,7 @@
73
73
 
74
74
  //sql文の定義
75
75
  String sql = "insert into test(sei,mei,sei_f,mei_f,gender,year,month,day,post,pre,address,tell,mail,bikou) "
76
- + "values(?,?,?,?,?,?,?,?,?,?,?,?)";
76
+ + "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
77
77
  //実行するSQL文と7パラメータ
78
78
  PreparedStatement stmt1=conn.prepareStatement(sql);
79
79
  stmt1.setString(1,sei);