What is reason for following sql code couldn't insert data?
问题 My database have two column. One column is auto increment id(Primary Key) and other is 'Sentence' column. Manually type something and I can insert that value. But when I'm trying insert variable value that gives error message. I tried different ways. ('?') /( ? )/(?) Not work anything for me. int s1=9; String s2="Kasuni"; String sql = "INSERT INTO sentences (Sentence) VALUES ( ? )"; PreparedStatement pstmtJ = conn.prepareStatement(sql); //pstmtJ.setInt(1, s1); pstmtJ.setString(1,s2); pstmtJ