jdbc 中带有日期值的 IllegalArgumentException; Openbase sql
我有一个 WebObjects 应用程序 Openbase db,并且在批处理操作期间执行原始行(非 ORM)查询时遇到了以前从未见过的异常。看起来 jdbc 适配器正在数据库中抛出日期值,并且无法将原始数据强制转换为正确的类型。它实际上会杀死应用程序并结束导出过程。以下是跟踪中最相关的两行:
java.lang.IllegalArgumentException
at java.sql.Date.valueOf(Date.java:138)
at com.openbase.jdbc.f.getDate(Unknown Source)
我尝试将列类型从日期更改为日期时间到时间戳,并相应地调整 eo 模型,但异常仍然存在。我想知道我能做些什么来解决这个问题,特别是如果有人知道我可以用来识别可能坏行的更复杂的查询机制? Openbase 的文档非常稀疏,我希望也许有人知道如何使用 openbase sql 使用模式来识别可能的错误值。或者,采用其他一些方法来识别问题。谢谢。
I have a WebObjects app, Openbase db, and I'm getting a never before seen exception when doing a raw rows (non ORM) query during a batch operation. It looks like the jdbc adaptor is throwing on a date value in the db and is unable to coerce the raw data into the proper type. It literally kills the app and ends the export process. Here's the top two relevant lines from the trace:
java.lang.IllegalArgumentException
at java.sql.Date.valueOf(Date.java:138)
at com.openbase.jdbc.f.getDate(Unknown Source)
I've tried changing the column type from date, to datetime to timestamp, and adjusting the eo model accordingly, but the exception remains. I'm wondering what I can do to resolve this, specifically if anybody knows a more sophisticated query mechanism I can employ to identify the possibly bad rows? Openbase's documentation is pretty sparse, and I'm hoping maybe somebody knows how to use patterns to identify possible bad values using openbase sql. Or, some other means of identifying the issue. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,该问题是由于 Openbase 版本和 java 版本之间的版本不匹配造成的。不幸的是,我别无选择,只能重写转储例程以使用批量保存openbase函数,然后解析出生成的csv。有趣的是,导致问题的相同日期打印得很好,这使得可以节省更多行。摘要:坚持使用开源数据库;除非您要走向高端,否则像 Openbase 这样的解决方案就不再有优势了。
Turns out the problem was due to a version mismatch between the Openbase version and the java version. Unfortunately, I had no choice but to rewrite the dump routine to use the bulk save openbase function, and then parse out the resulting csv. Interestingly, the same dates that were causing problems printed just fine, which enabled saving a lot more rows. Summary: stick with the open source db's; unless you're going high end, there's no advantage to solutions like Openbase anymore.