大概是ODBC的连接结构 typedef struct connection { int type; /* magic number */ struct connection *next_class_list; /* static list of all dbc handles */ char msg[ LOG_MSG_MAX ]; /* buff to format msgs */ int state; /* state of connection */ DMHENV environment; /* environment that own's the connection */ void *dl_handle; /* handle of the loaded lib */ char dl_name[ 256 ]; /* name of loaded lib */ struct driver_func *functions; /* entry points */ struct driver_func ini_func; /* optinal start end functions */ struct driver_func fini_func; int unicode_driver; /* do we use the W functions in the */ /* driver ? */ SQLHANDLE driver_env; /* environment handle in client */ SQLHANDLE driver_dbc; /* connection handle in client */ int driver_version; /* required version of the connected */ /* driver */ int driver_act_ver; /* real version of the driver */ int statement_count; /* number of statements on this dbc */ EHEAD error; /* keep track of errors */ char dsn[ SQL_MAX_DSN_LENGTH + 1 ]; /* where we are connected */ int access_mode; /* variables set via SQLSetConnectAttr */ int access_mode_set; int login_timeout; int login_timeout_set; int auto_commit; int auto_commit_set; int async_enable; int async_enable_set; int auto_ipd; int auto_ipd_set; int connection_timeout; int connection_timeout_set; int metadata_id; int metadata_id_set; int packet_size; int packet_size_set; SQLLEN quite_mode; int quite_mode_set; int txn_isolation; int txn_isolation_set; SQLINTEGER cursors; void *cl_handle; /* handle to the cursor lib */ int trace; char tracefile[ INI_MAX_PROPERTY_VALUE + 1 ]; #ifdef HAVE_LIBPTH pth_mutex_t mutex; /* protect the object */ int protection_level; #elif HAVE_LIBPTHREAD pthread_mutex_t mutex; /* protect the object */ int protection_level; #elif HAVE_LIBTHREAD mutex_t mutex; /* protect the object */ int protection_level; #endif int ex_fetch_mapping; /* disable SQLFetch -> SQLExtendedFetch */ int disable_gf; /* dont call SQLGetFunctions in the driver */ int dont_dlclose; /* disable dlclosing of the handle */ int books_on; /* books are set on */ void *pooled_connection; /* points to t connection pool structure */ int pooling_timeout; int ttl; char driver_connect_string[ 1024 ]; int dsn_length; char server[ 128 ]; int server_length; char user[ 128 ]; int user_length; char password[ 128 ]; int password_length; char cli_year[ 5 ]; struct attr_struct env_attribute; /* Extended attribute set info */ struct attr_struct dbc_attribute; struct attr_struct stmt_attribute; struct save_attr *save_attr; /* SQLConnectAttr before connect */ #ifdef HAVE_ICONV iconv_t iconv_cd_uc_to_ascii; /* in and out conversion descriptor */ iconv_t iconv_cd_ascii_to_uc; char unicode_string[ 64 ]; /* name of unicode conversion */ #endif struct env_lib_struct *env_list_ent;/* pointer to reference in the env list */ } *DMHDBC;
Technical differences between ODBC and OLE DB are summarized in the following table.ODBC OLE DB Data access API Database component APIs C-level API COM API SQL-based tabular data All tabular and multidimensional data SQL-based standard COM-based standard Native providers provide all features Component architecture allows reusable components to provide common features
OLE DB技术提供了一组较低级的数据库操作函数如连接等(一般以动态连接库形式发布) MS为了使人们更易于使用这种技术进行操作,于是提出了一种新的也就是ADO数据库访问技术。主要是对OLE DB的一些函数进行封装,使之更容易使用如果想知道它们的关系,你可以参考一下李维的Delphi5高效数据库编程那本书,前几章印象之中就是介绍这些个东西的
来自itpubLoveWinter: 说说 ODBC,OLE DB 是一个层次上的东西,ODBC是比较老的标准了, 但是各种数据库都支持的; OLE DB 是比较新的东东,ADO则是基于OLEDB的标准,由微软 提出并实现的数据访问方式,同理BDE是Inprise(Borland)公司 自己实现的数据访问方式。 关于OLEDB是如何被实现的,就是通过Provider,各个数据库厂商在发布数据库产品时,都会发布相应的OLE DB Provider,利用这个Provider, 开发人员就能够很轻松地进行数据库编程了。
有详细介绍,只能提供这么多帮助
sql->odbc打包->关系型数据库的客户端处理->sql*net->database抛砖引玉也好 抛砖引砖也好希望大家砸死我,最好是砸成相片
提供了一些进行数据访问的函数方法。
ADO(ActiveX Data Objects ),RDO( Remote Data Objects)是访问数据库的一个对象(可以使用某些函数方法,操作其结果集对数据库进行操作)
序管理器(Driver Manager)、驱动程序(Driver)、数据源(Data Source)。驱动程序
管理器与驱动程序对于应用程序来说都表现为一个单元,它处理ODBC函数调用。* 应用程序(Application)
应用程序本身不直接与数据库打交道,主要负责处理并调用ODBC函数,发送对数据
库的SQL请求及取得结果。
* 驱动程序管理器(Driver Manager )
驱动程序管理器是一个带有输入程序的动态链接库(DLL),主要目的是加载驱动程
序,处理ODBC调用的初始化调用,提供ODBC调用的参数有效性和序列有效性。
* 驱动程序(Driver)
驱动程序是一个完成ODBC函数调用并与数据之间相互影响的DLL,当应用程序调用
SQLBrowseConnect( ),SQLConnect( )或SQLDriverConnect( )函数时,驱动程序管
理器装入驱动程序。
* 数据源(Data Source)
包括用户想访问的数据以及与其相关的操作系统、DBMS和用于访问DBMS的网络平
台。
typedef struct connection
{
int type; /* magic number */
struct connection *next_class_list; /* static list of all dbc handles */
char msg[ LOG_MSG_MAX ]; /* buff to format msgs */
int state; /* state of connection */
DMHENV environment; /* environment that own's the
connection */
void *dl_handle; /* handle of the loaded lib */
char dl_name[ 256 ]; /* name of loaded lib */
struct driver_func *functions; /* entry points */
struct driver_func ini_func; /* optinal start end functions */
struct driver_func fini_func;
int unicode_driver; /* do we use the W functions in the */
/* driver ? */
SQLHANDLE driver_env; /* environment handle in client */
SQLHANDLE driver_dbc; /* connection handle in client */
int driver_version; /* required version of the connected */
/* driver */
int driver_act_ver; /* real version of the driver */
int statement_count; /* number of statements on this dbc */
EHEAD error; /* keep track of errors */
char dsn[ SQL_MAX_DSN_LENGTH + 1 ]; /* where we are connected */
int access_mode; /* variables set via SQLSetConnectAttr */
int access_mode_set;
int login_timeout;
int login_timeout_set;
int auto_commit;
int auto_commit_set;
int async_enable;
int async_enable_set;
int auto_ipd;
int auto_ipd_set;
int connection_timeout;
int connection_timeout_set;
int metadata_id;
int metadata_id_set;
int packet_size;
int packet_size_set;
SQLLEN quite_mode;
int quite_mode_set;
int txn_isolation;
int txn_isolation_set; SQLINTEGER cursors;
void *cl_handle; /* handle to the cursor lib */
int trace;
char tracefile[ INI_MAX_PROPERTY_VALUE + 1 ];
#ifdef HAVE_LIBPTH
pth_mutex_t mutex; /* protect the object */
int protection_level;
#elif HAVE_LIBPTHREAD
pthread_mutex_t mutex; /* protect the object */
int protection_level;
#elif HAVE_LIBTHREAD
mutex_t mutex; /* protect the object */
int protection_level;
#endif
int ex_fetch_mapping; /* disable SQLFetch -> SQLExtendedFetch */
int disable_gf; /* dont call SQLGetFunctions in the driver */
int dont_dlclose; /* disable dlclosing of the handle */
int books_on; /* books are set on */
void *pooled_connection; /* points to t connection pool structure */
int pooling_timeout;
int ttl;
char driver_connect_string[ 1024 ];
int dsn_length;
char server[ 128 ];
int server_length;
char user[ 128 ];
int user_length;
char password[ 128 ];
int password_length;
char cli_year[ 5 ];
struct attr_struct env_attribute; /* Extended attribute set info */
struct attr_struct dbc_attribute;
struct attr_struct stmt_attribute;
struct save_attr *save_attr; /* SQLConnectAttr before connect */
#ifdef HAVE_ICONV
iconv_t iconv_cd_uc_to_ascii; /* in and out conversion descriptor */
iconv_t iconv_cd_ascii_to_uc;
char unicode_string[ 64 ]; /* name of unicode conversion */
#endif
struct env_lib_struct *env_list_ent;/* pointer to reference in the env list */
} *DMHDBC;
是Microsoft OLD对象标准的一个实现。OLE DB对象本身是COM对象,并支持这种对象的所有必需的借口。ADO(Active Data Object):动态数据对象。这是使用OLE DB的一组对象。
一种简单的对象模型,可以被数据消费者用来处理任何OLE DB数据。
《数据库处理:原理,方法,实现》---好像是这个名字,原来南京新华书店有的,好像还是英文的,应该也有中文的。是本数据库方面的经典教材。
ODBC体系结构:WEB服务器
|---|--------|---------------|
|应 | 驱动 |DBMS驱动程序1 |------dbms1-----db
|用 | 程序 |DBMS驱动程序2 |------dbms2-----db
| |管理程序 |DBMS驱动程序3 |------dbms3-----db
| | |DBMS驱动程序4 |------dbms4-----db
|---|--------|---------------|
画得不好,见谅!
我总认为odbc就像java一样是种解释性的通用数据库连接平台
而oledb就像是c语言一样比较接近底层,dbo就当是c++吧
然后呢dbms就像是汇编语言,db就算是机器代码了
是不是有较大的偏差?
至于他的详细机制就不怎么清楚了
反正写程序的时候连接总是从别处拷过来的
:)
ADO(ActiveX Data Objects ),RDO( Remote Data Objects)是访问数据库的一个对象(可以使用某些函数方法,操作其结果集对数据库进行操作)是了!
我总认为odbc就像java一样是种解释性的通用数据库连接平台
而oledb就像是c语言一样比较接近底层,dbo就当是c++吧
然后呢dbms就像是汇编语言,db就算是机器代码了很透彻,佩服
Data access API Database component APIs
C-level API COM API
SQL-based tabular data All tabular and multidimensional data
SQL-based standard COM-based standard
Native providers provide all features Component architecture allows reusable components to provide common features
MS为了使人们更易于使用这种技术进行操作,于是提出了一种新的也就是ADO数据库访问技术。主要是对OLE DB的一些函数进行封装,使之更容易使用如果想知道它们的关系,你可以参考一下李维的Delphi5高效数据库编程那本书,前几章印象之中就是介绍这些个东西的
以上是个人观点,仅供参考
说说
ODBC,OLE DB 是一个层次上的东西,ODBC是比较老的标准了,
但是各种数据库都支持的;
OLE DB 是比较新的东东,ADO则是基于OLEDB的标准,由微软
提出并实现的数据访问方式,同理BDE是Inprise(Borland)公司
自己实现的数据访问方式。 关于OLEDB是如何被实现的,就是通过Provider,各个数据库厂商在发布数据库产品时,都会发布相应的OLE DB Provider,利用这个Provider, 开发人员就能够很轻松地进行数据库编程了。