除了 Sun 专有的之外,还有其他好的 CachedRowSet 实现吗?
我正在使用 javax. sql.rowset.CachedRowSet
在我的应用程序的一部分,但是我只能找到有关使用专有的 sun 实现的信息 com.sun.rowset.CachedRowSetImpl
或 Oracle 特定实现。
sun 实现不受支持且可能会更改。如果我将来想部署到非 Sun 虚拟机,使用此功能也可能会导致问题,最后它会在我们的构建日志中留下无法抑制的警告,从而掩盖其他警告。
是否有一个开源替代实现可以与我的应用程序一起部署,并且可以跨多个数据库良好运行?至少支持MySQL。
I am investigating using javax.sql.rowset.CachedRowSet
in part of my application, however I can only find information on using the proprietary sun implementation com.sun.rowset.CachedRowSetImpl
or Oracle specific implementations.
The sun implementation is unsupported and subject to change. Using this could also cause problems if I want to deploy to non-Sun virtual machines in the future, and finally it leaves unsuppressible warnings in our build logs which can mask other warnings.
Is there an open source alternative implementation that we I can deploy with my application that will work well across multiple databases? At a minimum something that supports MySQL.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您不应该直接实例化 CachedRowSet 的实现 - 使用其 Provider 来获取实例:请参阅 http://docs.oracle.com/javase/7/docs/api/javax/sql/rowset/RowSetProvider.html(从JDK7开始可用)
其实CachedRowSet的接口和相关工厂是标准/便携式。
像下面这样的东西应该可以解决问题:
You shouldn't be directly instantiating implementation of CachedRowSet -- use its Provider to obtain an instance: see http://docs.oracle.com/javase/7/docs/api/javax/sql/rowset/RowSetProvider.html (available since JDK7)
In fact, CachedRowSet's interface and related factory are standard/portable.
Something like the following shoud do the trick:
这是我改进的 CachedRowSetImpl 实现,以支持 MySQL 5.x 名称和标签。基于这个人的实现 回复:2.1.6 的回归
Here is my improved implementation of CachedRowSetImpl to support MySQL 5.x names and labels. Based on the implementation of this guy Re: Regression from 2.1.6
Oracle 实现是开源的
该问题错误地指出 Oracle RowSet 实现是专有的。它不是;它已经是开源的。
源代码根据 GNU 通用公共图书馆 (GPL) 版本 2 具有“类路径”例外的许可证。阅读 源代码以查看许可证。
所以他们不能撤回。只要您遵守 GPL 的条款,您和其他人就可以自由维护或修改这些类。
JDBC 驱动程序实现
此外,一些 JDBC 驱动程序还提供 RowSet 的实现。我不知道是否有开源的,但这将是探索的一种途径。
Oracle Implementation Is Open-Source
The question incorrectly states that the Oracle RowSet implementation is proprietary. It is not; it already is open-source.
The source code is released as free software under the GNU General Public Library (GPL) version 2 license with "Classpath" exception. Read the source code to see the license.
So they cannot be withdrawn. You and others are free to maintain or modify these classes provided you follow the terms of the GPL.
JDBC Driver Implementation
Also, some JDBC drivers provide an implementation of RowSet. I do not know if any are open-source, but that would be one avenue to explore.