search
HomeDatabaseMysql Tutorial数据库连接技术之OLEDB

数据库连接技术之OLEDB

Jun 07, 2016 pm 03:59 PM
odbcblogtechnologydatabaseconnect

之前的博客介绍了ODBC和JDBC,这次简单的介绍一下OLE DB。ODBC的总结不知道是没贴到博客上还是不在这个博客上,我再找找,没有的话我再补充到时候。好了,开始吧。 回顾 之前呢介绍过了ODBC和JDBC基本的结构是一样的,也就是本质一致。都是是访问数据库的一套

之前的博客介绍了ODBC和JDBC,这次简单的介绍一下OLE DB。ODBC的总结不知道是没贴到博客上还是不在这个博客上,我再找找,没有的话我再补充到时候。好了,开始吧。

回顾

之前呢介绍过了ODBC和JDBC基本的结构是一样的,也就是本质一致。都是是访问数据库的一套统一的接口,是一系列的规范和对数据库访问的API。区别只是在于ODBC是由C++语言实现的而JDBC是有Java实现的,之所以出现JDBC是因为Java程序和C++的ODBC之间的通信不便。可以说ODBC和JDBC二者之间的关系是横向的,而OLE DB相对与ODBC的关系则是纵向的。为什么这么说呢?

OLE DB之历史

为什么说OLE DB((Object Linking and Embedding, Database)和ODBC之间的关系是纵向的呢。这还是要从ODBC说起,ODBC是一套接口,但是ODBC只支持访问关系型数据库,既二维数据数据库。但是随着技术的发展显然我们需要面对的不在只是关系型的数据库,还需要访问不能使用SQL访问的非关系行和层次结构行数据,包括邮件系统中的数据、Web上的文本、目录服务等形式。因此,从数据源的角度来说OLE DB 和ODBC的关系如下图:

\

基于COM标准

ODBC是基于API的实现,而OLE DB则是基于COM标准。也就是说在实现上ODBC必须支持几乎所有的DBMS特征和功能,而OLE DB则可以部分实现。这里不太理解可以查查什么事COM标准。
OLE DB构成
OLE DB包括几个逻辑组件,因为其基于COM标准,所以组件之间相互独立,仅保持通信。
数据提供者(Data Provider):凡是通过OLE DB将数据提供出来的,即数据库提供者。数据提供者的概念可以和ODBC中的驱动程序对比理解。
数据消费者(Data Consumer):使用了OLE DB提供的数据的程序或组件。
服务组件(Service Component):执行数据提供者和数据消费者之间的数据传递工作。
业务组件(Bussiness Component):利用服务组件专门完成某种特定业务信息处理,是可以重用的功能组件。

OLE DB和ADO

之前的博客绝对是介绍过ADO了,这里ADO是OLE DB的进一步封装,在程序中的关系如下:

\
总的来说:OLE DB是ODBC的扩充,它基于COM标准,具有比ODBC更高的灵活性。不过最终也还是链接数据库的一套标准。只不过相对与ODBC来说更底层。
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How does MySQL handle data replication?How does MySQL handle data replication?Apr 28, 2025 am 12:25 AM

MySQL processes data replication through three modes: asynchronous, semi-synchronous and group replication. 1) Asynchronous replication performance is high but data may be lost. 2) Semi-synchronous replication improves data security but increases latency. 3) Group replication supports multi-master replication and failover, suitable for high availability requirements.

How can you use the EXPLAIN statement to analyze query performance?How can you use the EXPLAIN statement to analyze query performance?Apr 28, 2025 am 12:24 AM

The EXPLAIN statement can be used to analyze and improve SQL query performance. 1. Execute the EXPLAIN statement to view the query plan. 2. Analyze the output results, pay attention to access type, index usage and JOIN order. 3. Create or adjust indexes based on the analysis results, optimize JOIN operations, and avoid full table scanning to improve query efficiency.

How do you back up and restore a MySQL database?How do you back up and restore a MySQL database?Apr 28, 2025 am 12:23 AM

Using mysqldump for logical backup and MySQLEnterpriseBackup for hot backup are effective ways to back up MySQL databases. 1. Use mysqldump to back up the database: mysqldump-uroot-pmydatabase>mydatabase_backup.sql. 2. Use MySQLEnterpriseBackup for hot backup: mysqlbackup--user=root-password=password--backup-dir=/path/to/backupbackup. When recovering, use the corresponding life

What are some common causes of slow queries in MySQL?What are some common causes of slow queries in MySQL?Apr 28, 2025 am 12:18 AM

The main reasons for slow MySQL query include missing or improper use of indexes, query complexity, excessive data volume and insufficient hardware resources. Optimization suggestions include: 1. Create appropriate indexes; 2. Optimize query statements; 3. Use table partitioning technology; 4. Appropriately upgrade hardware.

What are views in MySQL?What are views in MySQL?Apr 28, 2025 am 12:04 AM

MySQL view is a virtual table based on SQL query results and does not store data. 1) Views simplify complex queries, 2) Enhance data security, and 3) Maintain data consistency. Views are stored queries in databases that can be used like tables, but data is generated dynamically.

What are the differences in syntax between MySQL and other SQL dialects?What are the differences in syntax between MySQL and other SQL dialects?Apr 27, 2025 am 12:26 AM

MySQLdiffersfromotherSQLdialectsinsyntaxforLIMIT,auto-increment,stringcomparison,subqueries,andperformanceanalysis.1)MySQLusesLIMIT,whileSQLServerusesTOPandOracleusesROWNUM.2)MySQL'sAUTO_INCREMENTcontrastswithPostgreSQL'sSERIALandOracle'ssequenceandt

What is MySQL partitioning?What is MySQL partitioning?Apr 27, 2025 am 12:23 AM

MySQL partitioning improves performance and simplifies maintenance. 1) Divide large tables into small pieces by specific criteria (such as date ranges), 2) physically divide data into independent files, 3) MySQL can focus on related partitions when querying, 4) Query optimizer can skip unrelated partitions, 5) Choosing the right partition strategy and maintaining it regularly is key.

How do you grant and revoke privileges in MySQL?How do you grant and revoke privileges in MySQL?Apr 27, 2025 am 12:21 AM

How to grant and revoke permissions in MySQL? 1. Use the GRANT statement to grant permissions, such as GRANTALLPRIVILEGESONdatabase_name.TO'username'@'host'; 2. Use the REVOKE statement to revoke permissions, such as REVOKEALLPRIVILEGESONdatabase_name.FROM'username'@'host' to ensure timely communication of permission changes.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor