OleDB 与 ODBC:其中之一是否不需要为所有 Oracle、MySQL、SQL Server 安装驱动程序?

发布于 2024-07-27 03:50:24 字数 545 浏览 2 评论 0原文

我希望我的应用程序能够与多个数据库供应商合作。 换句话说,根据客户端的数据库基础架构,数据库模式将部署在 Oracle、MySQL、SQL Server 之一上。 我在使用 ODBC 和 OleDB 之间,选择时必须考虑以下关键要求:

  • 必须从应用程序内部创建 DB 架构(有人告诉我 ODBC 在这种情况下可能会出现问题,这是真的吗? )
  • 强烈希望最终用户不需要安装任何附加软件(即 Oracle Instant Client 等)。 因此,驱动程序最好是:

    1. 已与 Windows 捆绑在一起。 Windows 是否有 ODBC/OleDB 的通用版本?
    2. 能够以某种方式与应用程序捆绑在一起。 在 Java 中的 IE 中,我可以将 MySQL 的 JDBC 驱动程序作为 .jar 文件与我的应用程序捆绑在一起。 可以通过包含 .dll 文件来完成此操作吗?
  • 强烈希望最终用户不需要进行任何外部配置,例如创建 ODBC 数据源

    非常

干杯!

I want my application to be able to work with multiple db vendors. In other words, depending on the DB infrastructure of the client, the db schema will be deployed on one of Oracle, MySQL, SQL Server. I am between using ODBC and OleDB, and the following key requirements that must be taken into account for the selection:

  • the DB schema must be created from within the application (I was told that ODBC may be problematic in this case, is this true?)
  • it is strongly desirable that the end users are not required to install any additional software (i.e. Oracle Instant Client etc). So, the driver should be preferably either:

    1. already bundled with Windows. Does Windows have a generic version of ODBC / OleDB?
    2. be able to be bundled in a way with the application. I.E. in Java, I can bundle the JDBC driver for MySQL as a .jar file with my application. Can this be done by including a .dll file?
  • it is strongly desirable that the end users are not required to make any external configuration, such as creating ODBC datasources

Cheers!

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

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

发布评论

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

评论(4

囚你心 2024-08-03 03:50:24

您确实需要安装适当的数据库特定驱动程序。

一旦安装,连接字符串在某种程度上也将依赖于数据库。

使用 ADO.NET,通过使用通用接口,代码中的许多数据库交互可以是独立的(例如 < code>IDbCommand)而不是提供者特定的子类,但仍然需要提供者特定的工厂。

即使如此,SQL 方言和数据类型也有很大的变化。

预计需要非常熟悉构建自己的摘要、控制反转 (IoC) 和调试每个不同的数据库。 后者强烈表明从项目开始就积极跨多个数据库平台进行调试,以避免突然需要大量的移植工作。

You do need to have an appropriate, database specific driver installed.

Once this is installed the connection string will also be, to some degree, database dependent.

Using ADO.NET much database interaction in code can be independent by using the common interfaces (e.g. IDbCommand) rather than the provider specific subclasses, but a provider specific factory will still be needed.

Even then, SQL dialects and datatypes have significant variation.

Expect to need to be very familiar with building your own abstracts, inversion of control (IoC) and debugging each different database. The latter would strongly indicate debugging actively across multiple database platforms from the project start to avoid sudden need for significant porting effort.

淤浪 2024-08-03 03:50:24

大多数 ODBC/OLEDB 驱动程序使用“通用语言”,但仍需要供应商提供的某种本机设备驱动程序或“客户端安装”才能正确连接到数据库。

您想要寻找的是一个合适的 ADO.NET 驱动程序,它将内置所有必需的库,或者可能只需要第二个 DLL 来配合它,而无需“客户端安装”。 这还允许轻松使用 app.config 文件中的 Connectin 字符串以及 ADO.NET 提供的所有优点。

以下是您需要的一些常见链接:

Most ODBC/OLEDB drivers are using a "common language" which still requires some kind of native device driver or "client install" provided by the vendor to properly connect to the database.

What you want to look for is a proper ADO.NET driver, which will have all the required libraries built into it, or it may only require a second DLL to go with it that doesn't not require a "client install". This will also allow for easy use of the Connectin String in your app.config file and all the goodness that ADO.NET provides.

Here are some links to the common ones you need:

記憶穿過時間隧道 2024-08-03 03:50:24

两者都需要数据库驱动程序。 如果不是,ODBC 层不知道如何连接到远程数据库。

Both need the database drivers. If not the ODBC layer does not know how to connect to remote database.

忱杏 2024-08-03 03:50:24

嗯,是的,但是您不需要 ODBC 或 OLEDB 来执行此操作。 您可以从此处获取适用于 SQL Server、MySQL 和 Oracle 的 100% 本机 ADO.NET 提供程序 http ://www.datadirect.com/products/net/index.ssp

Well, yes but you need neither ODBC or OLEDB to do this. You can get 100% native ADO.NET providers for SQL Server, MySQL and Oracle from here http://www.datadirect.com/products/net/index.ssp.

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