新手求助
org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [insert into teacher (name,title,password) values(?,?,?)]; nested exception is java.sql.SQLException: No value specified for parameter 2
部分代码如下
public int add(Teacher teacher) {
String sql = "insert into teacher (name,title,password) values(?,?,?)";
int num = jdbcTemplate.update(sql, teacher);
return num;
}
报这个
Struts has detected an unhandled exception:
Messages: 1.No value specified for parameter 2
2.PreparedStatementCallback; bad SQL grammar [insert into teacher (name,title,password) values(?,?,?)]; nested exception is java.sql.SQLException: No value specified for parameter 2
File: com/mysql/jdbc/SQLError.java
Line number: 1,078