连接多个结果集 [英] Joining multiple result set

查看:127
本文介绍了连接多个结果集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试开发一个Java应用程序,该应用程序基本上将来自多个数据源的数据合并为RDBMS.情况就是这样.

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

我已经创建了到两个数据源的连接,可以说是一个MSSQL数据库和其他Oracle.同样,在每个连接上,用户都可以创建一个包含SQL查询和连接的DataObject(一个Java对象).在连接上执行查询并显示结果.

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.

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

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

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

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

    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.

    推荐答案

    我建议使用前者.对我来说,这就像获取实体列表一样简单,并且可以基于某些过滤器将其添加到单个列表中.

    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.

    这篇关于连接多个结果集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆