Firebird odbc для linux

How to Install the Firebird ODBC Driver on Linux

The unixODBC package must be installed Firebird must also be installed

The ODBC driver packages for Linux are gzipped tar files. After gunzip they should be processed by tar, or you can rename them to * .tar.gz and use Midnight Commander to unpack them (for example).

To build from sources (recommended), requires the development package for unixODBC:

  1. Download and unpack the Firebird driver sources
  2. Rename «makefile.linux» in .source/Builds/Gcc.lin to «makefile»
  3. Set the evironment variables FBINCDIR (Firebird include directory) and FBLIBDIR (Firebird lib directory) if necessary.
  4. Run make (this creates the library libOdbcFb.so in a subdirectory)
  5. It’s possible to copy the library to /usr/local/lib64 (or any preferred directory) or run: make install (this symlinks the library from the unixODBC directory)

To install from the binary package:

  1. Copy libOdbcFb.so to /usr/local/lib64 or any other desired destination directory.

Configuration, depends on the Linux distribution, but somewhere in /etc or /etc/unixODBC should be two files:

odbc.ini and odbcinst.ini

Add to odbcinst.ini:

You can test the connection using UnixODBC ISQL (not Firebird’s) using the following:

isql -v employee

If you have connection problems, make sure that the directory where you placed the Firebird ODBC shared library (/usr/local/lib64/libOdbcFb.so) is on the system loadable library path. if not you could set

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/odbc or more simply export LD_LIBRARY_PATH=/usr/lib/odbc

If you still have problems then the next thing is to try the following and see if you can see what the problem is.

Источник

Installing on Linux (DEB) — ODBC Driver for Firebird

Prerequisites

ODBC Driver for Firebird works under control of an ODBC driver manager. ODBC driver manager is not distributed along with our driver and must be installed separately.

ODBC Driver for Firebird is compatible with UnixODBC driver manager.

In case when using other ODBC driver managers, ODBC Driver for Firebird will be installed, but it will require manual modification of configuration files of these managers.

Installation

Let’s consider how to install the Devart ODBC driver on Linux from a DEB package, for example, on Ubuntu. There are two ways to install the driver either manually or via the command line.

GUI installation

  1. Download the DEB package of the required bitness from the Devart website.
  2. Navigate to the folder with the downloaded package («Downloads» by default) and double-click it.
  3. In the opened dialog, click the Install button.

  • If the installation is successfully completed, the Install button changes into the Remove one.
  • Command-line installation

    1. Download the DEB package from the Devart website.

    By default the required package will be downloaded into the

    /Downloads folder (or the selected one);

  • Run the ‘Terminal’ program;
  • Navigate to the folder with the downloaded package cd

    /Downloads (if you downloaded the package into another folder, you need to specify the path to this folder as the cd command parameter):

    To install the devartodbcfirebird_i386.deb on a 32-bit system, use the following command:

    To install the devartodbcfirebird_amd64.deb on a 64-bit system, use the following command:

    Driver is installed successfully.

    To activate the driver, perform the steps described in the Product Activation article.

    Test connection

    After the driver is installed, a DSN with the name DEVART_FIREBIRD is created. You can use it to test connection with FIREBIRD server. For this, perform the following steps:

    Источник

    Howto install firebird odbc driver for unixodbc (from source )

    Here is an small guide on installing firebird odbc driver from source (alternate you can install it from binary repository )

    A good reference to unixodbc is located here
    First step is to have installed unixodbc on fedora:

    yum install unixODBC unixODBC-develop

    and on ubuntu (debian):

    sudo apt-get install unixodbc unixodbc-dev

    then checkout the odbc driver :

    cvs -d:pserver:anonymous@firebird.cvs.sourceforge.net:/cvsroot/firebird login
    cvs -z3 -d:pserver:anonymous@firebird.cvs.sourceforge.net:/cvsroot/firebird co OdbcJdbc

    cd OdbcJdbc/Builds/Gcc.lin
    make -f makefile.linux

    Next read the readme.linux

    driver seems to be in directory OdbcJdbc/Builds/Gcc.lin/Release

    cd OdbcJdbc/Builds/Gcc.lin/Release
    sudo cp *.so /usr/lib
    sudo ln -s /usr/lib/libIscDbc.so /usr/lib/IscDbc

    create content in the folowing files
    cat /etc/odbcinst.ini
    [Firebird]
    Description = Firebird ODBC Driver
    Driver = /usr/lib/libOdbcJdbc.so
    Setup = /usr/lib/libOdbcJdbcS.so
    Threading = 1
    FileUsage = 1
    CPTimeout =
    CPReuse =

    cat /etc/odbc.ini
    [help]
    Description = Firebird
    Driver = Firebird
    Dbname = localhost:/var/lib/firebird/2.0/system/help.fdb
    User = SYSDBA
    Password = masterkey
    Role =
    CharacterSet =
    ReadOnly = No
    NoWait = No

    ps: i assume that firebird and g++ are already installed on the system

    Источник

    Linux, Internet технологии, программирование и администрирование 1C

    четверг, 14 февраля 2013 г.

    Настройка доступа к Firebird/interBase Server через ODBC. Ubuntu 12.04

    Установка необходимых пакетов:

    Читайте также:  Может ли слететь активация windows 10 после обновления

    Создаем необходимый симилинк:
    #Для i386

    На момент написания статьи последней версией драйвера была 2.0.1.152.
    Последнюю версию на текущий момент см. тут

    Качаем драйвер и копируем его куда следует:
    #Для i386

    #Для x86_64
    Для 64-битной системы драйвер оказался недоработанным (косяки работы с датой и «съедались» некоторые буквы у char`в). Пришлось собирать из svn свой.

    Собсна, переходим к конфигурированию.

    и добавляем секцию для Firebird/InterBase:

    Настраиваем непосредственно систему ODBC. Создаем DSN.
    Сделать это можно 2-мя способами:

    Используя мастер настройки:

    Используя ODBC администратор:

    2. Путем редактированию конфигов:

    Добавляем в него соответствующую секцию:

    где:
    Description — описание драйвера.
    Driver — имя раздела из файла /etc/odbcinst.ini.
    Dbname — путь к базе данных на Firebird/InterBase сервере, к которой нужно получить доступ.
    User и Password — пользователь, грантованный на работу с данной БД.
    Role — роль, с которой осуществляется подключение к БД.

    CharacterSet — кодировка БД.

    Устанавливаем параметры драйвера в систему:

    Устанавливаем настройки ODBC в систему:

    . ВАЖНО.
    Если в /etc/odbc.ini вносятся какие-либо изменения, процедуру установки ностроек ODBC в систему, необходимо повторить (sudo odbcinst -i -s -l -f /etc/odbc.ini)

    Проверка установленных DSN:

    Проверка подключения к БД:

    видим что то типа:

    Чтобы удалить параметры драйвера из системы:

    Чтобы удалить регистрацию DSN из системы:

    Во избежание конфликтов, лучше удалить локальный настройки ODBC:

    Источник

    Firebird ODBC/JDBC Driver 2.0 Manual

    1. ODBC/JDBC Driver for Firebird Client Applications

    This manual documents the official driver for connecting ODBC-aware client applications with a Firebird database, implementing the combined capabilities of dedicated wrappers for the Firebird C/C++ API functions with an ODBC-to-JDBC bridge to enable cross-platform connections in a Java VM environment.

    1.1. About the Firebird ODBC driver

    The Firebird ODBC driver supports client applications connecting to Firebird databases from Windows, FreeBSD, Solaris, and Linux. Separate kits are available for both Windows and the POSIX platforms, for use with 32-bit or 64-bit clients. On Windows, the respective dynamic OdbcFb.dll and the static OdbcFb.lib libraries are packaged in both .zip archives and executable installers. The POSIX packages come as either the binaries for x86 and amd64, respectively, both named libOdbcFb.so , or as a source code tarball. This help file is also included in the installation kits.

    1.1.1. Features Supported

    Compiling for both 32-bit and 64-bit Windows clients on the Microsoft SDK base

    Thread-safe querying and other processing

    Creating databases by means of functions SQLConfigDataSource , SQLDriverConnect , SQLExecDirect .

    Multiple simultaneous transactions per connection, with varying transaction attributes if need be. For example, one read-only transaction, one or more simultaneous read/write transactions.

    Transparent connection pooling via transaction settings

    Firebird database events returned by triggers and stored procedures

    Use of Microsoft ODBC cursors ( odbccr32.dll , odbccu32.dll )

    Firebird Services API (backup & restore, statistics, repair) by way of the function SQLConfigDataSource

    The schemas SCHEMA or OWNER for cases where a schema is required for cross-DBMS compatibility in SQL queries

    Fully functioning SQL syntax support for Services transactions via Firebird’s gpre pre-compiler language (“EmbedSQL”)

    Use of the COM interface for Microsoft Distributed Transaction Coordinator (DTC)

    2. Installing the Driver

    The kit that you install will depend on what you plan to use it for. Regardless of whether you intend to connect to a 64-bit or a 32-bit Firebird server, you must install the driver and the Firebird client ( fbclient.dll on Windows, libfbclient.so on Linux) that matches the “bitness” of your client application.

    Installation is similar for both options. You can install both the 32-bit and the 64-bit driver on the same machine if the user is going to access Firebird from multiple applications of mixed bitness. Care will be needed to ensure that each application will connect using the correct DSN for the required driver.

    . because we have been asked: if you want to connect your Windows application — Excel or LibreCalc, for example — to your database running on a Linux or other POSIX server, you want the Windows driver, not the POSIX one. See also the note below about the Firebird client library.

    2.1. Downloading the Driver

    The Downloads section at https://www.firebirdsql.org/en/odbc-driver/ clearly identifies the bitness of the various kits available, with the latest release at the top of the page. For example, the 32-bit installer kit for Windows, at the time this document was prepared, was named Firebird_ODBC_2.0.5.156_Win32.exe , indicating that it is the executable installer for the 32-bit version. The following table should help to indicate what you will need. The “N.n.n.xxx” infix used here indicates “Major1.Major2.Minor.Subrelease”. The “Subrelease” part changes the most frequently.

    Table 1. Firebird ODBC/JDBC Driver Kits

    Source code, which is bitness-independent. Recommended for POSIX installs with unusual rules about the location of libraries — instructions below.

    Executable installer for use with 32-bit client applications. Use this for an initial installation.

    Executable installer for use with 64-bit client applications. Use this for an initial installation.

    Zip kit containing just the dynamic and static 32-bit libraries and documentation. This can be used to update the library of an existing installation when the driver is not active. On a 64-bit machine, the older version can be found in the folder c:\Windows\SySWOW64 and Administrator privileges will be required to overwrite it.

    Zip kit containing just the dynamic and static 64-bit libraries and documentation. This can be used to update the library of an existing installation when the driver is not active. On a 64-bit machine, the older version can be found in the folder c:\Windows\system32 and Administrator privileges will be required to overwrite it. It will not work on a 32-bit machine.

    32-bit binary for a POSIX client, gzipped

    64-bit binary for a POSIX client, gzipped

    2.2. Getting the Right Firebird Client Library

    All Firebird RDBMS kits contain at least one version of the Firebird client library. If there is only one, then it will have the same “bitness” as the server installation kit itself.

    Make sure you get the fbclient library that has the same major version number as the server it is going to connect with.

    On a 32-bit Windows installation, fbclient.dll is in Firebird’s bin folder in Firebird versions lower than version 3.0. For version 3.0 and above, it is in Firebird’s root folder, e.g. C:\Program Files (x86)\Firebird\Firebird\Firebird_3_0 , or wherever Firebird was installed.

    On a 64-bit Windows installation, the version of fbclient.dll in Firebird’s bin folder (or Firebird’s root folder for version 3.0 and higher) is the 64-bit one. In some builds, the 32-bit client is located in a folder, named either WOW64 or system32, that is beneath Firebird’s root.

    If your ODBC DSN setup is going to need the 32-bit fbclient.dll and it is not there, you will need to download the 32-bit Windows .zip kit from the main Firebird download page, extract the 32-bit client from it and place it in the same folder as your application. An alternative is to download the 32-bit installer instead and perform a client-only install, configuring the installer to place it where you want it to be.

    The POSIX server kits always come with only the matching libfbclient.so . You will need to extract it from an .i686 kit if your POSIX client application is 32-bit.

    Have the client library in its proper place before installing the driver and configuring the DSN.

    The most current version of the ODBC/JDBC driver is expected to be compatible with any supported version of Firebird.

    2.3. Installing the Driver on Windows

    If you are doing a first-time install of the driver, or if you have uninstalled an older version, it is recommended that you use the executable installer. These instructions will assume that you are installing the 32-bit driver, but the procedure is the same for installing the 64-bit one. Under the hood, the 32-bit driver library will be installed into \windows\sysWOW64 on a 64-bit Windows. Any other install will place the driver in windows\system32 .

    Download or move the executable installer kit to the desktop. Right-click on it and select Run as Administrator.

    Click your way through the screens until you reach the one in which you configure your preferences for the installation:

    If you want or need to, you can have the driver installed in some other location than the one offered by the installer as the default. Use the Browse button to find the location where you want to have the driver installed.

    The installer will create the \Firebird_ODBC subfolder if it does not exist already.

    Lastly, the installer will display the configuration you have chosen. If you happy with it, just click Install and it is done.

    You might observe here that, on our system, we keep our own dedicated “Programs64” and “Programs32” folders under C:\Windows . That is simply preference as to how we organise our server and monitor the volume of stuff installed by Windows updates into its own program folders.

    The .chm and .html documents noted on that screen are older evolutions of this document that are still built in with the kits at the point of this writing.

    2.4. Installing the Driver on Linux

    There are two prerequisites for installing the ODBC/JDBC driver on Linux:

    The “unixODBC” package must be installed

    Firebird must be installed, initially at least, for testing the installation

    2.4.1. Unpacking the Files

    The ODBC/JDBC driver packages for Linux are gzipped tar files. After gunzip they should be processed by tar, or you can rename them to .tar.gz and use a tool such as Midnight Commander to unpack them.

    2.4.2. Building from Sources

    Building from source code (recommended), requires the development package for unixODBC. Proceed with the following steps:

    Download and unpack the Firebird driver sources

    Rename makefile.linux in .source/Builds/Gcc.lin to makefile

    Set the evironment variables FBINCDIR (Firebird include directory) and FBLIBDIR (Firebird lib directory) if necessary.

    Run make which will create the library libOdbcFb.so in a subdirectory

    It is possible to copy the library to /usr/local/lib64 or any preferred directory; or run make install to symlink the library from the unixODBC directory

    2.4.3. Installing the Binary Package

    To install from the binary package, copy libOdbcFb.so to /usr/local/lib64 , /usr/local/lib32 or any other desired destination directory, as appropriate.

    3. Firebird ODBC Configuration

    The configuration settings you make in an ODBC data source description (“DSN”) define the attributes for connecting to a specific database. On Windows, a dialog box captures parameters that correspond to the connection attributes. On Linux, the parameters are configured manually in text ( .ini ) files.

    3.1. Configuring a DSN on Windows

    First, find the applets in the Administrative Tools section of the machine where you are going to set up a “channel” through which your application program is going to connect with a Firebird database, either on the same machine or elsewhere in the local or wide-area network.

    On a 64-bit machine, you will find two such applets:

    For the purpose of our example, we want to pick the item ODBC Data Sources (32-bit). Obviously, if we had installed the 64-bit driver with the intention of using it for a 64-bit application, we would pick the 64-bit item from this menu instead.

    Don’t left-click the item: right-click and, from the context menu, select Run as Administrator. This is necessary because you are about to set up a System DSN.

    Click on the tab labelled System DSN, where you will begin setting up your DSN.

    Click Add…​ on the first screen to bring up the list of drivers on the next. Select the Firebird/InterBase(r) driver, then click Finish.

    3.1.1. The DSN Settings

    After clicking Finish on the previous screen, you are presented with a form into which you will enter the parameters for a connection and will be able to test that they all work.

    Kit Name Purpose
    Table 2. Parameters for the DSN Configuration

    Data Source Name (DSN)

    REQUIRED. A unique, meaningful name indicating the type of connection or its use. Make it brief as you can expand the narrative elsewhere. Examples: “Connect from FbEmbed” or “ConnectFbServer”

    Optional. Can be used to provide more details about the data source.

    REQUIRED. Full address of the database, as required for an embedded or network connection. If the connection is remote, it can be in TCP/IP or WNET format. TCP/IP is recommended. Firebird database aliases are supported. Refer to Connection Examples.

    May be required. Local path to the Firebird client library. For embedded connections to a sub-V.3 Windows server, it can point to the copy of fbembed.dll in the application directory; otherwise, point it to where you have located the bitness-compatible Firebird remote client library unless you are certain the correct library will be found automatically in a system location.

    Optional, since login credentials can be captured during connection to a Firebird database. If it is not configured, the ODBC interface will prompt for a user ID (UID or USER) at connection time.

    Optional, since login credentials can be captured during connection to a Firebird database. If it is configured, it should be the password for the supplied User ID. Otherwise, the ODBC interface will prompt for a password (PWD or PASSWORD) at connection time. Any password configured is encrypted automatically and saved in odbc.ini . Storing the password here should not be a security risk.

    Optional. If it is defined and the login is by SYSDBA, role is ignored; otherwise, the login credentials, whether stored or captured at connection, must have been granted that role prior to the login attempt.

    May be blank. Sets the default character set of the client.

    Options (set here in DSN or specify dynamically)

    Read (default write)

    Transactions are read/write by default. Check to make transactions read-only.

    Nowait (default wait)

    The transaction will wait if it encounters a lock conflict. Check to have the transaction return an error immediately upon encountering a lock conflict.

    When a transaction is set for WAIT conflict resolution, express the length of time in seconds until the lock times out and a lock conflict error is returned ( isc_lock_timeout ).

    Other optional parameters

    SQL dialect for the client to use in accessing the database. The only valid options for Firebird are 1 or 3. Note, Dialect 1 is not compatible with quoted identifiers; Dialect 3 will not accept strings delimited by double quotes.

    Causes pairs of double quotes to be treated solely as delimiters of case-sensitive object identifiers. Attempts to pass double quotes as string delimiters will be treated as errors in both dialects. Note, double-quoted strings have always been illegal in Dialect 3.

    This option affects the way the client treats the property SQL_IDENTIFIER_CASE . SQL_IC_UPPER (value=1) is the default, treating all identifiers as stored in upper case characters. Check to select SQL_IC_SENSITIVE (value=3) to have the interface treat all identifiers that are not in all upper case as though they were case-sensitive. This is not recommended! For an explanation, see Note (1) below.

    Default is NO . The effect of checking this is to change the setting to YES . In that case, every identifier in every statement will be double-quoted automatically. The need to set this on would be highly unusual and would need to be well understood to avoid non-stop errors.

    Drop-down list offering three options for treatment of SQL schemas, which Firebird does not support. Normally, leave this at the default setting Set null field SCHEMA. For some details, see Note (2) below.

    If this setting is checked on, it would cause this statement

    Источник

    Читайте также:  Основные компоненты windows live 2011 что это такое
    Оцените статью
    Parameter Entry