MongoDB ODBC Driver for BI ConnectorВ¶
OverviewВ¶
The MongoDB ODBC Driver for BI Connector provides connectivity between a SQL client and the MongoDB Connector for BI . The ODBC driver enables users to create a Data Source Name (DSN) and connect a variety of BI tools to the BI Connector . It includes the BI Connector authentication plugin, which implements the client side of MongoDB-supported authentication mechanisms.
CompatibilityВ¶
The MongoDB ODBC Driver for BI Connector is compatible with BI Connector version 2.5 and later. The latest production version of BI Connector is available from the MongoDB Download Center.
Supported PlatformsВ¶
Windows (32-bit and 64-bit)
Before installing the ODBC Driver for Windows, ensure that the Microsoft Visual C++ Redistributable for Visual Studio 2015 is installed on your system.
The 1.0.16 edition of ODBC Manager included with the MongoDB ODBC driver is not compatible with macOS Catalina. If you are on Catalina, download and install the latest version (1.0.19) of ODBC manager.
Using the ODBC DriverВ¶
Configure your system to use the ODBC driver by setting up a DSN. A DSN holds configuration information about your BI Connector instance, including server address, port number, and login credentials. See Create a System DSN for instructions on setting up a DSN on your system.
В© MongoDB, Inc 2008-present. MongoDB, Mongo, and the leaf logo are registered trademarks of MongoDB, Inc.
Mongodb odbc driver windows
pmeredit released this Aug 4, 2020
Version 1.4.2 fixes the need to have libssl installed using brew on macos. The provided libssl and libcrypto from the installer are now self-contained.
Please refer to the README and to the BI Connector reference documentation for usage instructions.
rychipman released this Jun 18, 2020
Version 1.4.1 of the MongoDB ODBC Driver fixes a bug that prevented 1.4.0’s newly added TLS 1.2 support from working on macOS As of this release, TLS 1.2 is supported on all platforms.
Please refer to the README and to the BI Connector reference documentation for usage instructions.
rychipman released this Jun 3, 2020
Version 1.4.0 of the MongoDB ODBC Driver builds with OpenSSL instead of yaSSL on macOS, enabling TLS 1.2 support for the macOS ODBC driver. As of this release, TLS 1.2 is supported on all platforms.
Please refer to the README and to the BI Connector reference documentation for usage instructions.
rychipman released this Jan 16, 2020
Version 1.3.0 of the MongoDB ODBC Driver builds with OpenSSL instead of yaSSL on Windows, enabling TLS 1.2 support for the Windows ODBC driver. As of this release, TLS 1.2 is supported on both Windows and Linux.
Please refer to the README and to the BI Connector reference documentation for usage instructions.
deafgoat released this Oct 3, 2018
Version 1.2.0 of the MongoDB ODBC Driver includes support for the Ubuntu 14.04 Linux distribution. It also fixes an installation problem on OS X.
Please refer to the README and to the BI Connector reference documentation for usage instructions.
deafgoat released this Sep 6, 2018
Version 1.1.0 of the MongoDB ODBC Driver includes support for the SCRAM-SHA-256 authentication mechanism on all supported platforms.
Version 1.1.0 of the MongoDB ODBC Driver also adds support for several Linux distributions including Ubuntu 16.04 and RHEL 7.
Please refer to the README and to the BI Connector reference documentation for usage instructions.
Mongodb odbc driver windows
MongoDB ODBC Driver
This is a release of MongoDB ODBC driver, the driver that enables ODBC applications to communicate with MongoDB’s Connector for Business Intelligence.
For the avoidance of doubt, this particular copy of the software is released under the version 2 of the GNU General Public License and is a fork of the MySQL Connector/ODBC (formerly MyODBC) version 5.7.21.
The original README file provided with the upstream repository can be found below.
Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2018 MongoDB Inc.
License information can be found in the COPYING file.
MySQL FOSS License Exception We maintain the MySQL FOSS License Exception from MySQL: we want free and open source software applications under certain licenses to be able to use the GPL-licensed MongoDB ODBC (specified GPL-licensed MySQL client libraries) despite the fact that not all such FOSS licenses are compatible with version 2 of the GNU General Public License. Therefore there are special exceptions to the terms and conditions of the GPLv2 as applied to these client libraries, which are identified and described in more detail in the FOSS License Exception at http://www.mysql.com/about/legal/licensing/foss-exception.html
This distribution may include materials developed by third parties. For license and attribution notices for these materials, please refer to the documentation that accompanies this distribution (see the «Licenses for Third-Party Components» appendix) or view the online documentation at http://dev.mysql.com/doc/
GPLv2 Disclaimer For the avoidance of doubt, except that if any license choice other than GPL or LGPL is available it will apply instead, Oracle elects to use only the General Public License version 2 (GPLv2) at this time for any software where a choice of GPL license versions is made available with the language indicating that GPLv2 or any later version may be used, or where a choice of which version of the GPL is applied is otherwise unspecified.
- Introduction
- Building Source
- Installing
- Binary Files
- MongoDB ODBC SDK
- Resources
This is the source or binary distribution of ODBC for MongoDB. This software is distributed with restrictions — please see the license information for details.
Open Database Connectivity (ODBC) is a widely accepted standard for reading/writing data. ODBC is designed in a similar manner to the MS Windows printing system in that it has a Driver Manager and Drivers. MongoDB ODBC is a driver for the ODBC system which allows applications to communicate with the MySQL Server using the ODBC standard. ODBC implementations exist on all popular platforms and MongoDB ODBC is also available on those platforms.
MongoDB provides support for ODBC by means of the MongoDB ODBC driver and the MongoDB Connector for Business Intelligence (BI Connector). MongoDB ODBC is ODBC 3.5x compliant, and provides a MySQL interface to MongoDB through the BI Connector. This ODBC driver is designed specifically for use with MongoDB’s Connector for Business Intelligence, and in conjunction with a MongoDB server.
To get all functionality from the ODBC 1.0 driver (e.g. transaction support) you should use it against MongoDB 3.6 or later, though less performant support is maintained for MongoDB 3.2+.
Please see the BUILD file for details on building the source code. This is included with the source distribution.
Please see the INSTALL file for details on installing.
The following, key, files are provided by MongoDB ODBC (the MS Windows names are included for reference but the file names for other platforms would be similar).
Driver (mdbodbca.dll and mdbodbcw.dll)
Setup Library (mdbodbcS.dll)
Library Loading Tester (dltest.exe)
MongoDB ODBC SDK
MongoDB ODBC provides an SDK for developers in the form of several reusable libraries. These libraries can be used to save development time/effort and to increase stability of resulting software.
For more information about MongoDB, see http://www.mongodb.com For more information about MySQL, see http://www.mysql.com.
About
ODBC driver for MongoDB Connector for Business Intelligence
Занятие 5 (работа приложение с MongoDB драйвером ODBC)
Занятие 5 (работа с драйвером ODBC )
«Курс: Базы данных. Раздел: документо-ориентированная СУБД MongoDB »
Автор: Герасимов Н.А.
Тема:Установка драйвера ODBC — MongoDB . Доступ к данным СУБД MongoDB из приложений, с использование DSN — источников. Разработка модуля чтения данных на VBA ( Excel ), VBScript .
Скачивание и установка драйвера ODBC — MongoDB
Классическим способом доступа к данным в базах данных различных производителей ( MicroSoft , IBM , Oracle [ MySql ] и др.) является организация взаимодействие программных приложений через объектный интерфейс, реализуемых драйверами ODBC ( Object Data Base Connect ).
В настоящее время практически для каждой СУБД существует свой ODBC -драйвер, который позволяет отделить пользовательское приложение от структуры и особенностей организации СУБД. Такой подход значительно упрощает процесс создания программных приложений. Более подробно о концепции ODBC интефейса приложений и совремнных СУБД можно ознакомится в работах[].
Рассмотрим процесс установки драйвера ODBC для MongoDB /
Драйвер CData ODBC для MongoDB 2018 позволяет получать данные MongoDB
в режиме реального времени непосредственно из любых приложений,
поддерживающих ODBC -соединение, наиболее поддерживаемого интерфейса для
подключения приложений к данным.
Для Windows Xp можно использовать инсталлятор драйвера MongoDBODBCDriver. exe
После установки ODBC драйвера приложения могут обращаться к MongoDB как к традиционной базе данных. Драйвер CData ODBC для MongoDB 2018 скрывает сложность доступа к данным и предоставляет дополнительные мощные функции безопасности, интеллектуальное кэширование, пакетное управление,
управление сокетами и многое другое.
Драйвер ODBC обеспечивает классическую схему взаимодействия приложении и базы данных, состоящую из следующих этапов:
— коннекция к серверу и выбор базы данных ( Connect to db );
— выполнение SQL -запроса ( Execute SQL query );
— вывод результата запроса в необходимый формат ( Output result ).
DSN ( Dynamic System Name ) – содержит всю необходимую информацию для коннекции с базой данных: тип и имя драйвера, имя сервера, имя базы данных, имя пользователя, пароль пользователя и другие данные.
В Windows имеется специальный сервис для управления DSN -системой, которая позволяет создавать, корректировать, удалять DSN .
Чтобы создать новый DSN необходимо в Windows выполнить:
Пуск->Панель управления->Администрирование->Источники ODBC .
Выбираем режим создания нового источника (кнопка Добавить). Появляется список драйверов, зарегистрированных в системе.
Из списка драйверов выбираем драйвер для MongoDB ( Devart ODBC for MongoDB ) и нажимает Готово.
Появляется форма параметров DSN . Заполняем форму с параметрами драйвера:сервер 127.0.0.1, порт стандартный 27017 и имя базы данных. Имя пользователя в нашем случае не используется.
Проверяем коннекцию нажатием кнопки Test Connection . И если получаем сообщение Connection successful , то нажимаем ОК.
В результате получаем новый DSN контакт с базой данных mongoDB .
Замечание: В процессе создания DSN формируется строка коннекции:
strConn=” DRIVER=
Созданный DSN можно использовать в приложениях для получения данных из базы.
Пример использования DSN в Excel
В данном разделе рассматривается пример использования созданого DNS в системе Excel для чтения данных из базы MongoDB .
В MongioDB создадим пример коллекции : коллекции emp (слотрудники) в базе db .
Spec:[ ‘ VB’, ‘C# ‘, ‘JavaScript ‘],
Для организации чтения данных из базы данных MongoDB с помощью Excel создадим новую книгу и войдем в режим Данные.
Выберем режим Импорт внешних данных->Создать запрос.
Появляется список созданных в ситеме DSN .
Из списка выбираем DSN с именем MongoDB и продолжаем движение по мастеру построения запросов.
Следующая форма показвает какие коллекции документов есть в базе db . С помщью кнопок «выбора» набираем необходимые поля для SQL -запроса
Нажиамем кнопку Далее. Если мы не используем условия для выбора данных, то можно пропустить несколько форм и дойти до формы, где можно указать «Показать запос в SQL »
Появится форма, в которой можно легко в режиме мыши « drag — and — drop » изменить запрос и посмотреть его в SQL -формате.
Окончательный вид SQL -запроса в нашем примере выглядит так:
SELECT emp.name, emp.age, emp.»Spec.0″, emp.»Spec.1″, emp.»Contact.city», emp.»Contact.tel»
Закрываем форму SQL -вида, задаем имя листа, на который будет выполняться вывод результата. На этом процесс создания запроса заканчивается
После выполнения SQL -запроса на Лист1 выдается результат (см. Рисс выше)
Таким образом, чтение данных из MongoDB возможно при помощи ODBC драйвера и SQL запросов.
Построение приложения на VBA .
В среде VBA Excel можно создать приложение двумя способами:
— с помощью мастера построителя макросов (т.е. программ на VBA с помощью макроркодера)
— программированием на VBA классическим способом, создавая программные модули в виде скриптов.
Общая схема использования макрорекодера для создания VBA -макросов (или скриптов) следующая:
— запускаем макрорекодер (вводим необходимые параметры: имя макроса, горячие клавиши для его запуска, комментарий);
— выполняем необходимую последовательность операций вручную (очень аккуратно);
— переходи в режим программирования Visual Basic ( Alt + F 11) и изучаем структуру созданного скрипта.
Построение макроса для чтения данных из базы MongoDB
Для создания макроса в автоматическом режиме включим режим Запись макроса (Сервис->Макросы->Начать макрос)
В окне параметров макроса введем Имя ( read _ mongodb ) и Описание. Нажмем ОК.
Теперь включается макрорекодер, который записывает все операции пользователя.
Для получения выборки данных из коллекции emp , выполним всю цепочку операций, которую проделали в пункте 3.
Внимание: когда на Лист1 появятся результаты выборки данных, не забудьте остановить макрос (Сервис->Остановить макрос), иначе макрорекодер будет продолжать писать скрипт.
В результате получится макрос (запрограммированная последовательность операций), которую можно посмотреть нажав клавиши Alt + F 11, которые переводят Excel в режим программирования. Вариант окна показан ниже.
Рассмотрим более внимательно текст созданного программного модуля (скрипта), который сгенерировал макрорекодер, запоминая наши операции.
Пояснение: Ntrcn Скрипт f находится между словом Sub и End Sub .
‘ read _ mongodb Макрос
‘ Макрос для чнения данных из БД MongoDB записан 25.08.2018 ( gera 01)
With ActiveSheet.QueryTables.Add( Connection:= _
«ODBC;DSN=MongoDB;Data Source=127.0.0.1;Database=db», Destination:=Range(«A1»))