groovy oracle数据库,groovy oracle date

There are lots of problems with Oracle DATE & TIMESTAMP and their

counterpart Java classes since they do not directly compare. DATE fields

in Oracle will give date & time where as TIMESTAMP gives you a bit more

information (down to millis I think). SQL92 says DATE is year, month &

day (which is why java.sql.Date only gives you this).

As Jon said you will be getting back an instance of java.sql.Date (the

metadata for this column will claim you'll be getting back a timestamp

but it lies; look up oracle.jdbc.V8Compatable for more information). The

only way to be 100% sure about what you're getting back is to ask for

the timestamp or change your Oracle fields from DATE to TIMESTAMP and

then you're more inline with how Java will deal with it.

Andy

P.S. If you do change the field data type you'll get back a

oracle.sql.TIMESTAMPZ object which is castable to a java.sql.Timestamp

Jon Carlson wrote:

> It

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值