griddb.github.io

— Overview of application development —

This chapter provides an overview of application development using the ODBC driver for GridDB.

Overview of ODBC

ODBC (Open Database Connectivity) is a standard interface for accessing database management system (DBMS) from Windows-compatible application advocated by Microsoft.

Relationship between ODBC driver and GridDB cluster
Relationship between ODBC driver and GridDB cluster

Operating environment

The ODBC driver used in GridDB can be used in the following OS.

Installation method

The ODBC driver for GridDB is included in the “\Windows\ODBC” directory of the installation media.

The installation method is as follows.

When installing a 64-bit driver

  1. Select the “GridStoreODBC_64bit_setup.bat”, right-click, and select Run as administrator.
  2. Check that the following files are copied to the following directory: C:\Program Files\TOSHIBA\GridStore\bin.
  1. Click the Windows button (Start), enter SystemPropertiesAdvanced.exe to open the , System Properties window and then click “Environment Variables” to open the settings screen for environment variables. Select Path under system environment variables, click on Enter, and add the installation directory C:\Program Files\TOSHIBA\GridStore\bin where the above files are located.

  1. Make sure the following directories do not contain libssl-1_1-x64.dll and libcrypto-1_1-x64.dll. The SSL function of the ODBC drivers for GridDB uses these libraries. Be aware of the fact those libraries contained in the following directories are used in preference to those in the media package. If the following directories do contain these libraries, place those libraries contained in the media package in the current directory where software which uses ODBC is located.

When installing a 32-bit driver

  1. Select the “GridStoreODBC_32bit_setup.bat”, right-click, and select Run as administrator.
  2. Check that the following files are copied to the following directory: C:\Program Files (x86)\TOSHIBA\GridStore\bin
  1. Click the Windows button (Start), enter SystemPropertiesAdvanced.exe to open the , System Properties window and then click “Environment Variables” to open the settings screen for environment variables. Select Path under system environment variables, click on Enter, and add the installation directory C:\Program Files(x86)\TOSHIBA\GridStore\bin where the above files are located.

  1. Make sure the following directories do not contain libssl-1_1.dll and libcrypto-1_1.dll. The SSL function of the ODBC drivers for GridDB uses these libraries. Be aware of the fact those libraries contained in the following directories are used in preference to those in the media package. If the following directories do contain these libraries, place those libraries contained in the media package in the current directory where software which uses ODBC is located.

Registration of ODBC data source

In order to access the GridDB database using GridDB ODBC, it is necessary to register the ODBC data source in advance. Registration of the ODBC data source is performed with the following procedure.

For 64-bit

  1. Start [ODBC data source (64-bit)] from [Management tools].

  2. Create a system data source (system DSN). Select “GridStore ODBC (x64)” when specifying the driver.

    Create system DSN
    Create system DSN
  3. Set up the connection data to the GridDB cluster when the GridDB ODBC setup screen appears.

    Setup screen
    Setup screen

[Input items]

[Buttons]

For 32-bit

  1. Start [ODBC data source (32-bit)] from [Management tools].
  2. Create a system data source (system DSN). Select “GridStore ODBC (x86)” when specifying the driver.
  3. Set up the connection data to the GridDB server in the GridStore ODBC setup screen. The configuration method is the same as the 64-bit version.

[Notice]

Registration of detailed configuration information

The detailed settings are optional, so set them when necessary.

Detailed configuration screen
Detailed configuration screen

[Input items]

[Buttons]

Connection method

If a BI/ETL tool is used, please specify the data source name set in the “GridStore ODBC setup screen”.

If ODBC API is used, specify the data source name set in the “GridStore ODBC setup screen” as well.

— Supported APIs —

This section describes the APIs supported by the GridDB ODBC driver. All ODBC APIs version 3 and some of the APIs version 2 are supported by the GridDB ODBC driver.

List of supported APIs

API support status is shown below.

Function name Support status
SQLBindCol
SQLBindParameter Only return SQL_SUCCESS
SQLBrowseConnect ×
SQLCancel Only return SQL_SUCCESS
SQLCloseCursor  
SQLColAttribute △ (with some unsupported parameters)
SQLColumnPrivileges
SQLColumns
SQLConnect
SQLDescribeCol △ (with some unsupported parameters)
SQLDescribeParam Only return SQL_SUCCESS
SQLDisconnect
SQLDriverConnect
SQLEndTran * (Only returns SQL_SUCCESS. SQL_ERROR, SQL_INVALID_HANDLE)
SQLError
SQLExecDirect
SQLExecute
SQLFetch
SQLFetchScroll Only return SQL_SUCCESS
SQLForeignKeys Only return SQL_SUCCESS
SQLFreeHandle
SQLFreeStmt
SQLGetConnectAttr Only return SQL_SUCCESS
SQLGetCursorName Only return SQL_SUCCESS
SQLGetData
SQLGetDescField ×
SQLGetDescRec
SQLGetDiagField Only return SQL_SUCCESS
SQLGetDiagRec
SQLGetEnvAttr △ (only some parameters are supported)
SQLGetFunctions
SQLGetInfo
SQLGetStmtAttr △ (with some unsupported parameters)
SQLGetTypeInfo
SQLMoreResults
SQLNativeSql Only return SQL_SUCCESS
SQLNumResultCols
SQLParamData ×
SQLPrepare
SQLPrimaryKeys
SQLProcedureColumns Only return SQL_SUCCESS
SQLProcedures Only return SQL_SUCCESS
SQLPutData ×
SQLRowCount Only return SQL_SUCCESS
SQLSetDescField ×
SQLSetDescRec ×
SQLSetEnvAttr Only return SQL_SUCCESS
SQLSetStmtAttr Only return SQL_SUCCESS
SQLSpecialColumns △ (Returns SUCCESS and only generates an empty ResultSet)
SQLStatistics
SQLTablePrivileges
SQLTables

See below for the API specifications.

— Samples —

Sample programs in the C language using ODBC API and VisualStudio project files are included in the file “gridstore-odbc-sample.zip”. (These are stored under \Windows\ODBC in the installation media.)

The samples are written and tested (operation check) in VisualStudio 2005 SP1.

Try to perform table creation, data registration, and search. The project settings are configured for 64-bit and 32-bit use.

The following ODBC data source settings are required to execute a program.

For 64-bit

For 32-bit