多个数据库连接
我们有 4 个产品,每个产品支持以下 4 个数据源。
- Oracle
- SQL Server 2005
- DB2
- Datopia
现在我们正在构建管理产品,它将与所有产品及其数据库进行交互。我们有一些要求,必须在单个查询中访问来自不同数据源的表。我们最初考虑使用 Oracle 透明网关创建数据库链接,然后访问不同数据源中的表。但这需要为其中一种产品安装oracle。在我们的环境中不能引入此限制(例如4个产品中2个可能安装了SQL Server,另外两个可能安装了DB2)。这是不受任何限制地连接到所有数据源的最佳方式。另一件事是,我们使用 java 连接到这些数据库。提前致谢。
We have 4 products and each supports below 4 datasources.
- Oracle
- SQL server 2005
- DB2
- Datopia
Now We are building Administration product which will interact will all the products and hence their databases.We have some requirements where we have to access tables from different datasources in a single query.We initially thought of using Oracle transparent gateway to create DB links and then access tables in different datasources. But this requires oracle to be installed for one of the products. This restrictions cannot be brought in our environment(For example among 4 products 2 may have SQL server installation and other two may have DB2 installation). Which is the best way to connect to all datasources with out any restriction. One more thing, we are using java to connect to these databases. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你没有说你的客户端软件使用什么样的框架。但如果它使用 Java、dotnet 或 PERL,您将能够使用该框架的数据访问模块来连接到各种表服务器。您可以轻松地从单个客户端进程连接到所有这些。
您的数据库访问不会完全透明。例如,您需要程序的某些方面特定于 Oracle 或 SQL Server。另一方面,如果您做得正确,那么在您的客户需要时添加 MySQL 和 PostgreSQL 支持并不困难。
您将面临相当沉重的 QA 负担 - 您需要对同时连接的所有四个表服务器的至少一个和两个实例进行测试,以确保一切正常。
但这种产品通常具有很高的价值,因此您应该能够证明 QA 工作的合理性。
You don't say what kind of framework your client software uses. But if it uses Java, dotnet, or PERL, you will be able to use that framework's data access modules to connect to the various table servers. You can connect to all of them from a single client process easily enough.
You db access won't be perfectly transparent. You'll need some aspects of your program to be Oracle- or SQL-Server- specific, for example. On the other hand, if you do this right, it won't be hard to add MySQL and PostgreSQL support if your customers need it.
You'll have a fairly steep QA burden -- you'll need to test with at least one and two instances of all four table servers connected simultaneously to make sure everything works.
But this kind of product usually has high value, so you should be able to justify the QA effort.