`
carrot
  • 浏览: 164422 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

queryForRowSet cant return full datetime precision

阅读更多
Assuming you are using Oracle here since this looks like a known issue with the 10g JDBC driver.

The 10g driver reports DATE columns as Timestamp in the metadata but if you do a getObject() you get a java.sql.Date. Oracle claims you should use the TIMESTAMP datatype instead if you want the time portion. Drawback here is that getObject() returns an oracle.sql.TIMESTAMP which does not extend any of the standard JDBC classes. To work around this you would have to do something like this:


SqlRowSet rset = jdbcTemplate.queryForRowSet(
"select cast(sysdate as timestamp) from dual");
try {
    while (rset.next()) {
    System.out.println("-> " +
         ((oracle.sql.TIMESTAMP)rset.getObject(1)).timestam pValue());
}
} catch (SQLException e) {
     e.printStackTrace();
}

We have a workaround for this in the queryForList methods but for queryForRowSet we depend on Sun's RowSet implementation to extract the data from the original ResultSet.
分享到:
评论

相关推荐

    Cant Find Anything-1.3.zip

    名称:Cant Find Anything -------------------- 版本:1.3 作者:uploadextsubmissions 分类:网页增强 -------------------- 概述:当正在搜索的网站不工作时,此扩展程序会为您提供活动网站。 描述: 网站没有...

    cant mustnt的区别PPT课件.pptx

    cant mustnt的区别PPT课件.pptx

    解决libarcsoft_face.dll:Cant‘t find dependent library报错

    解决libarcsoft_face.dll:Cant‘t find dependent library报错,相关文章:https://blog.csdn.net/chw0629/article/details/122557038

    Marco Cantù Object Pascal Handbook

    Marco Cantù Object Pascal Handbook The Complete Guide to the Object Pascal programming language for Delphi developers Delphi 10.1 Berlin Edition, June 2016

    cant的五种特殊句型PPT学习教案.pptx

    cant的五种特殊句型PPT学习教案.pptx

    i-still-cant-speak-english.rar_english

    i still cant speak english ,troduction method correction personalization

    信息安全_数据安全_If you cant trust the phone comp.pdf

    信息安全_数据安全_If you cant trust the phone comp 安全风险 边界防御 企业安全 漏洞分析 安全开发

    信息安全_数据安全_On the CANT Bus No One Can Hear .pdf

    在本文中,我们将深入探讨与“On the CANT Bus, No One Can Hear You Scream”相关的信息安全和数据安全议题,特别是在可信计算、法律法规、网络犯罪和安全对抗的背景下。这个主题涉及了汽车行业的CAN(Controller ...

    AS-23-Uhlmann-You-Can-Run-But-You-Cant-Hide.pdf

    AS-23-Uhlmann-You-Can-Run-But-You-Cant-Hide

    Alt Cant-开源

    【Alt Cant-开源】是一个专为Windows平台设计的小型应用程序,其主要功能是处理剪贴板中的URL。这款工具能够帮助用户对复制的网址执行多种缩短操作,同时提供了匿名浏览的功能,确保用户在进行网址转换时可以保护...

    解决python多线程报错:AttributeError: Cant pickle local object问题

    报错信息: Traceback (most recent call last): File “D:/flaskProject/test.py”, line 35...return self.apply_async(func, args, kwds).get() File “\lib\multiprocessing\pool.py”, line 657, in get raise se

    Writing.Windows.WDM.Device.Drivers.pdf

    Chris Cant的著作。转成pdf的文件了,方便大家学习。

    cant be too carefulPPT学习教案.pptx

    在英语表达中,"can't be too careful" 这个短语经常被用来强调无论怎样小心都不为过,尤其是在安全或者谨慎行事的场合。这句话的含义是,越小心越好,越谨慎就越能避免潜在的问题。例如,当你在街上行走时,你永远...

    AlxcTools.zip

    导出的oracle10g的dmp数据库文件,想导入到11g的oracle里面去,导入报错:can't recognize compressed file header.即需要修改dmp文件的文件名里面的版本号,用此软件修改:11g R2:V11.02.00 11g R1:V11.01.00 ...

    Delphi_2009_Handbook

    《Delphi 2009 Handbook》是一本由Marco Cantù编写的详尽技术手册,旨在为Delphi 2009的用户和开发者提供全面深入的指导与资源。本书于2008年11月在意大利皮亚琴察(Piacenza)首次发布,由Wintech Italia Srl出版...

    literally-cant-even:连字都看不清

    Chrome合金下载literally-cant-even.crx ,然后进入Chrome 的首选项、扩展程序,启用开发者模式,然后将文件拖到窗口中。发展克隆回购安装crxmake为 Chrome 构建( gem install crxmake ) 对每个浏览器进行更改运行...

    10.2.0.3版本 with改造递归查询

    SELECT '100000' cant_code, 'ȫ' cant_name, '0' super_code, '0' super_codex, '0' cant_note FROM dual UNION ALL SELECT cant_code, cant_name, DECODE(level, '3', '100000', super_code) super_code, ...

    opencv3.0交叉编译用parallel.cpp

    在ubuntu14.04中交叉编译中用到的parallel.cpp,地址在opencv-3.0.0/modules/core/src/parallel.cpp,详细步骤可参考我的博客http://blog.csdn.net/u012354697/article/details/50655597

Global site tag (gtag.js) - Google Analytics