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

質問編集履歴

2

タイトルの変更

2015/07/07 07:43

投稿

R.lawliet
R.lawliet

スコア41

title CHANGED
@@ -1,1 +1,1 @@
1
- データベースに「'」を用いずに日付をInsertって出来ますか?
1
+ java:PreparedStatementで「'」を用いずに日付をString型でInsertって出来ますか?
body CHANGED
File without changes

1

変数の中身を入力

2015/07/07 07:43

投稿

R.lawliet
R.lawliet

スコア41

title CHANGED
File without changes
body CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
 
14
14
  //プリペアードステートメントオブジェクトの生成
15
- PreparedStatement ps = con.prepareStatement(INSERT_QUERY);
15
+ PreparedStatement ps = con.prepareStatement(INSERT INTO BIRTHDAY_TABLE values(?););
16
16
  ps.setString(1,"'"+bean.getBirthday()+"'");
17
17
  ↑Stringで受け取る。"YYYY/mm/ss"
18
18