连接多个结果集
我正在尝试开发一个Java应用程序,它合并来自多个数据源的数据(基本上是RDBMS)。场景是这样的。
我创建了到两个数据源的连接,比如说 MSSQL 数据库和其他 Oracle。此外,在每个连接上,用户可以创建一个包含 SQL 查询和连接的 DataObject(Java 对象)。在连接上执行查询并显示结果。
现在我想要的是我的用户可以加入并过滤从多个 DataObject 获得的结果。
目前我正在寻找以下解决方案:
请就我的选择提出建议。另请研究其他解决方案。
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:
Please advice me on my choice. Also please can other solution be looked into.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议前者。对我来说,它就像获取实体列表一样简单,然后根据某些过滤器将它们添加到单个列表中。
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.
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.