用户登录
用户注册

分享至

hibernate 插入默认时间

  • 作者: 用户37979420
  • 来源: 51数据库
  • 2021-01-05
先获取系统时间,
HttpServletResponse response = ServletActionContext.getResponse();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
String dateTime=df.format(new Date());
然后把获取到的时间插入到数据库中.......



  show_sql 没有打印出来 那一定是没有执行sql语句,没有插入

但是打印出来了 也可能 插入数据库不成功 ,因为由于配置hibernate和数据库不一致的时候 满足hibernate 并不满足 数据库的 要求。

你的问题 连 hibernate 打印都不出 那只能说 没有执行插入方法。

你的问题太笼统,具体原因难说!
软件
前端设计
程序设计
Java相关