JAVA调用ORACLE存储过程时间类型参数没有日期

是因为使用cs.setDate()给数据库传参数只会传日期部分。
如果改用如下代码就可以:
cs.setTimestamp(3, new java.sql.Timestamp(dKssj.getTime()));
cs.setTimestamp(4, new java.sql.Timestamp(dJssj.getTime()));

cs.setTimestamp()可以将日期和时间部分都传给数据库。

猜你喜欢

转载自www.cnblogs.com/liwei1994/p/11493272.html