将时间写入mysql
String sql="insert into user_write values("+"null"+",'"+write.getUsername()+"','"+write.getTitle()+"','"+write.getContent()+"','"+write.getDate()+"');";
mysql字段为datatime,为什么写不进去呢?怎么样才能写进去呢
------解决方案--------------------是不是要加个引号哦
------解决方案--------------------datatime.now