3 回答

TA贡献1839条经验 获得超15个赞
setTimestamp(int parameterIndex, Timestamp x)
setTimestamp(int parameterIndex, Timestamp x, Calendar cal)
将指定的参数设置为 java.sql.Timestamp
值,使用给定的 Calendar
对象。驱动程序使用 Calendar
对象来构造sql。 TIMESTAMP
值,然后驱动程序将其发送到数据库。带着 Calendar
对象时,驱动程序可以在考虑自定义时区的情况下计算时间戳。如果没有 Calendar
对象时,驱动程序使用默认时区,即运行应用程序的虚拟机的时区。
setTimestamp(int parameterIndex, Timestamp x)
getTimestamp(..)
setTimestamp(int parameterIndex, Timestamp x, Calendar cal)
TIMESTAMP
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));stmt.setTimestamp(11, tsSchedStartTime, cal);
java.time.LocalDateTime
java.time.LocalTime
TIMESTAMP
TIME
get/set/updateObject
java.time.Local*
添加回答
举报