FUNCTION database.curren_date does not exist是怎么回事?
Connection con = DBUtil.getConnection();
String sql = "insert imooc_goddess( user_name,sex,age,birthday,email,mobile,"
+ "create_user,create_date,update_user,update_date,isdel)"
+ "values(?,?,?,?,?,?,?,curren_date(),?,curren_date(),? )";
PreparedStatement prepareStatement = con.prepareStatement(sql);
prepareStatement.setString(1, gs.getUser_name());
prepareStatement.setInt(2, gs.getSex());
prepareStatement.setInt(3,gs.getAge());
prepareStatement.setDate(4,new Date( gs.getBirthday().getTime()));
prepareStatement.setString(5, gs.getEmail());
prepareStatement.setString(6, gs.getMobile());
prepareStatement.setString(7, gs.getCreate_user());
prepareStatement.setString(8, gs.getUedate_user());
prepareStatement.setInt(9, gs.getIsdel());
prepareStatement.execute();
Goddess g = new Goddess();
g.setUser_name("宝宝");
g.setAge(22);
g.setSex(1);
g.setBirthday(new Date());
g.setEmail("25544544");
g.setMobile("15555555");
g.setCreate_user("wangwu");
g.setUedate_user("lisi");
g.setIsdel(1);
GoddessDao god = new GoddessDao();
god.addGoddess(g);
报错:
Exception in thread "main" com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: FUNCTION xiaokang.curren_date does not exist