为了账号安全,请及时绑定邮箱和手机立即绑定

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

正在回答

1 回答

是不是current_date啊?

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

FUNCTION database.curren_date does not exist是怎么回事?

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信