Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to explain why ODBC requires a database driver

Tags:

odbc

A month ago, I was showing a buddy how use .NET to query MySQL. It worked just fine, but he didn't understand why we needed a "driver" for MySQL in conjunction with ODBC. He though ODBC would be enough.

When he asked me why, I did my best, but my answer came up short.

What is the correct explanation for this question?

like image 802
Chris Avatar asked Dec 06 '22 03:12

Chris


1 Answers

The reason you need a driver is that ODBC is not in itself a driver for talking to databases: it's an abstraction and an API.

Essentially it is an adaptor layer designed to make all databases appear the same to the client application: you talk to the ODBC library, and it asks the driver manager to fulfill your request using the correct database (based on your connection string).

In order for your database brand to be compatible with ODBC therefore it must provide a driver which implements the required API in order that it can service requests from clients using the ODBC functions.

like image 97
jkp Avatar answered Jan 11 '23 09:01

jkp