慕粉1312236355
2017-06-26 10:49
public void addGoddess(Goddess g) throws SQLException{
Connection con=ww.getConnection();
String sql="insert into ta1 values (?,?,?,?,?,?,?,?,?,?,?,?)";
sta=con.prepareStatement(sql);
sta.setInt(1, g.getId());
sta.setString(2, g.getUse_name());
sta.setInt(3, g.getSex());
sta.setInt(4, g.getAge());
sta.setDate(5, new Date(g.getBirthday().getTime()));
sta.setString(6, g.getEmail());
sta.setString(7, g.getMobile());
sta.setString(8, g.getCreate_user());
sta.setDate(9, new Date(g.getCreate_date().getTime()));
sta.setString(10, g.getUpdate_user());
sta.setDate(11, new Date(g.getUpdate_date().getTime()));
sta.setInt(12, g.getIsdel());
sta.executeUpdate(sql);
}
你有代码吗
这是用报错信息
Exception in thread "main" java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?,?,?,?,?,?,?,?,?,?,?,?)' at line 1
JDBC之 “ 对岸的女孩看过来”
99328 学习 · 856 问题
相似问题