ODBC vs OLDB
Feem ntau, cov ntawv thov software raug sau ua hom lus tshwj xeeb (xws li Java, C, thiab lwm yam), thaum cov ntaub ntawv lees txais cov lus nug hauv qee hom lus tshwj xeeb (xws li SQL). Yog li ntawd, thaum daim ntawv thov software xav tau nkag mus rau cov ntaub ntawv hauv database, ib qho interface uas tuaj yeem txhais cov lus rau ib leeg (daim ntawv thov thiab database) yuav tsum tau. Txwv tsis pub, daim ntawv thov programmers yuav tsum kawm thiab koom nrog cov lus tshwj xeeb hauv lawv daim ntawv thov. ODBC (Qhib Database Connectivity) thiab OLEDB (Object Linking and Embedding, Database) yog ob qho kev cuam tshuam uas daws qhov teeb meem tshwj xeeb no. ODBC yog lub platform, hom lus thiab kev ua haujlwm ywj pheej interface uas tuaj yeem siv rau lub hom phiaj no. OLEDB yog tus ua tiav rau ODBC.
ODBC yog dab tsi?
ODBC yog qhov sib cuam tshuam rau kev nkag mus rau kev tswj hwm database (DBMS). ODBC yog tsim los ntawm SQL Access Group nyob rau hauv 1992 ib lub sij hawm tsis muaj tus qauv nruab nrab los sib txuas lus ntawm ib tug database thiab ib daim ntawv thov. Nws tsis nyob ntawm ib hom lus programming lossis database system lossis operating system. Cov programmers tuaj yeem siv ODBC interface los sau cov ntawv thov uas tuaj yeem nug cov ntaub ntawv los ntawm txhua qhov chaw khaws ntaub ntawv, txawm hais tias ib puag ncig nws tab tom khiav lossis hom DBMS nws siv.
Vim tias tus tsav tsheb ODBC ua tus txhais lus ntawm daim ntawv thov thiab cov ntaub ntawv, ODBC muaj peev xwm ua tiav cov lus thiab kev ywj pheej ntawm lub platform. Qhov no txhais tau hais tias daim ntawv thov raug tshem tawm ntawm lub nra ntawm kev paub cov ntaub ntawv tshwj xeeb cov lus. Hloov chaw nws tsuas yog paub thiab siv ODBS syntax thiab tus tsav tsheb yuav txhais cov lus nug rau hauv cov ntaub ntawv hauv hom lus nws tuaj yeem nkag siab. Tom qab ntawd, cov txiaj ntsig tau xa rov qab rau hauv hom ntawv uas tuaj yeem nkag siab los ntawm daim ntawv thov. ODBC software API tuaj yeem siv nrog ob qho tib si kev sib raug zoo thiab tsis sib raug zoo database systems. Lwm qhov zoo dua ntawm kev muaj ODBC ua ib qho nruab nrab nruab nrab nruab nrab ntawm daim ntawv thov thiab cov ntaub ntawv yog tias txhua zaus cov ntaub ntawv hloov pauv, cov software tsis tas yuav hloov kho. Tsuas yog qhov hloov tshiab rau ODBC tus tsav tsheb yuav txaus.
OLEDB yog dab tsi?
OLEDB yog cov ntaub ntawv API tsim los ntawm Microsoft. Nws tso cai rau nkag mus rau cov ntaub ntawv los ntawm ntau qhov chaw ntawm cov ntaub ntawv. Nws yog siv los ntawm Microsoft's COM (Component Object Mode). OLEDB raug suav hais tias yog tus ua tiav rau ODBC, thiab nws tuaj yeem tswj cov ntaub ntawv hauv qib siab dua piv rau ODBC. Hauv qhov tseem ceeb, OLEDB txuas ntxiv ODBC cov yam ntxwv rau cov ntaub ntawv tsis muaj feem cuam tshuam (xws li cov khoom siv databases thiab cov ntawv nthuav qhia). Qhov ntawd txhais tau tias, OLEDB tuaj yeem siv nrog cov ntaub ntawv uas tsis siv SQL. OLEDB tau tsim los ua ib feem ntawm Microsoft Data Access Components (MDAC).
Dab tsi yog qhov txawv ntawm ODBC thiab OLEDB?
Yog tias tus programmer tsis paub COM, ces ODBC yog qhov kev xaiv zoo dua. Tab sis, ODBC tsuas yog zoo rau cov ntaub ntawv sib raug zoo, thaum OLEDB yog qhov tsim nyog rau ob qho tib si kev sib raug zoo thiab tsis muaj kev sib raug zoo databases. Yog tias cov ntaub ntawv tsis txhawb OLE (tsis yog-OLE ib puag ncig) ces ODBC yog qhov kev xaiv zoo tshaj. Yog tias ib puag ncig tsis yog SQL, ces koj yuav tsum siv OLEDB (vim ODBC ua haujlwm nrog SQL nkaus xwb). Ib yam li ntawd, yog tias yuav tsum muaj cov ntaub ntawv sib koom ua ke, ces OLEDB yuav tsum tau siv ODBC. Txawm li cas los xij, rau 16-ntsis cov ntaub ntawv nkag mus rau ODBC yog tib txoj kev xaiv (OLEDB tsis txhawb 16-ntsis). Thaum kawg, OLEDB yog qhov kev xaiv zoo tshaj plaws rau kev txuas mus rau ntau lub databases ib zaug (ODBC tuaj yeem txuas rau ib lub database nkaus xwb).