连接多个结果集

发布于 2024-08-20 22:44:34 字数 454 浏览 5 评论 0原文

我正在尝试开发一个Java应用程序,它合并来自多个数据源的数据(基本上是RDBMS)。场景是这样的。

我创建了到两个数据源的连接,比如说 MSSQL 数据库和其他 Oracle。此外,在每个连接上,用户可以创建一个包含 SQL 查询和连接的 DataObject(Java 对象)。在连接上执行查询并显示结果。

现在我想要的是我的用户可以加入并过滤从多个 DataObject 获得的结果。

目前我正在寻找以下解决方案:

  • JDO/Hibernate - 我将从查询执行获得的 ResultSet 创建一个对象,并将使用带有过滤器和连接条件的多个对象。
  • Java RowSet - 我将在结果集上创建一个 RowSet 对象,并使用 JoinRowSet 和 FilteredRowSet 来连接多个结果集。

    请就我的选择提出建议。另请研究其他解决方案。

  • I am trying to develop a Java application which merges data from multiple data source basically RDBMS. The scenario is some thing like this.

    I have creates a connection to two data sources, lets say a MSSQL database and other Oracle. Also on each connection a user can create a DataObject( a Java object) which contains a SQL query and a connection. The query is executed on the connection and result are displayed.

    Now what I want is that my user can join and filter result obtained from multiple DataObject.

    Currently I am looking on the following solution:

  • JDO/Hibernate - I will create a object from the ResultSet obtained from the query execution and will use the multiple objects with filter and joining condition.
  • Java RowSet - I will create a RowSet object over result sets and user JoinRowSet and FilteredRowSet to join multiple result set.

    Please advice me on my choice. Also please can other solution be looked into.

  • 如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

    扫码二维码加入Web技术交流群

    发布评论

    需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

    评论(2

    淡墨 2024-08-27 22:44:34

    我建议前者。对我来说,它就像获取实体列表一样简单,然后根据某些过滤器将它们添加到单个列表中。

    I would suggest the former. To me its as simple as getting the list of entities, and add those in a single list, based on some filter.

    风筝在阴天搁浅。 2024-08-27 22:44:34

    Oracle 附带一个通用 ODBC 网关,允许您将 Oracle 数据库与另一个数据库链接,因此您可以使用 SQL 连接两个数据库等中的表,就好像两个表都在 Oracle 上一样。有关详细信息,请参阅此链接。通过这样做,您不必在 Java 程序中复制数据库功能。

    Oracle comes with a generic ODBC gateway that allows you to link the oracle database with another database, so you can join tables from both databases etc. with SQL, as if both tables were on Oracle. See this link for details. By doing that, you don't have to replicate database features in your java program.

    ~没有更多了~
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文