Introduction
PreviousNext

Introduction

JDBC Bridge for ODBC driver can read data from any JDBC Driver using familiar SQL language. Driver allows to query nested structure and output as flat table.

Content

Video Tutorial

Step-By-Step

Setup JRE

Before we start, We need to install JAVA Runtime (JRE) or Java Development Kit (JDK). We recommend installing JRE8 (other JRE version(s) might work too). There are several ways to get JRE8 installer but we recommend using any of the following ways. Skip below steps if you have JAVA Runtime already installed.

  1. Make sure you have Java8 (or higher) Installed - JRE or JDK. Download Java8 JRE from here (Latest OpenJDK JRE8 -Windows x64 Installer by Amazon Corrento)
  2. There are many places from which you can get Java. For example Oracle JAVA , OpenJDK distribution by Amazon, OpenJDK distribution by Adoptium

Calling Driver in your App

After you install JRE and ZappySys ODBC Drivers you can access Driver few ways in various apps (see below).

  1. Using ODBC DSN (User level DSN or System level DSN)
  2. Using Direct ODBC Connection String
  3. Using Data Gateway - Connect client app/server from Windows, Linux, Mac OS to ZappySys Data Gateway using Microsoft SQL Server Driver (i.e. JDBC, ODBC, OLEDB ...)
Regardless which method you choose from your App below steps will help you to configure your connectivity in correct way.
If you choose to connect using direct ConnectionString then also try below Steps to create correct ConnectionString which you can copy from DSN Config Tool and paste inside your App / Programming Language Code.

Using ODBC DSN (User level DSN or System level DSN)

Configure DSN

In this section you will learn how to Configure ODBC DSN. Later on this DSN can be used to use ZappySys Driver. ODBC DSN can be stored at Machine Level (for all users) or Current User Level. In this case we are going to load data into Microsoft Excel from PostgreSQL Storage using ZappySys JDBC Bridge ODBC Driver.
  1. Type odbcad32.exe in your search box and launch the DSN Config utility.
  2. If you want access for yourself then stay of User DSN Tab. If you want grant access other users then go to System DSN tab. For SQL Server Integration go to System Tab and add new System DSN rather than User DSN. Click New button.
    ZappySys ODBC Driver - Open UI
  3. From the Driver list Select ZappySys ODBC Driver. For this example select [ZappySys JDBC Bridge Driver].
    ZappySys ODBC Driver - Create JDBC Bridge Driver
  4. Now, When you see DSN Config Editor with zappysys logo first thing you need to do is change default DSN Name at the top and Configure JDBC Bridge Driver. Enter Credentials (In this Example We have used PostgreSQL Credentials) and then Click on Test Connection to verify your credentials.
    Note : Enter suitable JDBC Driver Credentials, You can read data from any JDBC Driver
    
    ODBC JDBC Bridge Driver - Create Connection
  5. Click on Preview Tab, Select Table from Tables Dropdown or you can enter or modify a SQL query and click on Preview Data.
    This example shows how to write simple SQL query (Structured Query Language). It uses WHERE clause. For more SQL Queries click here.
    SELECT orderid, customerid, orderdate, orderamount
    FROM "public"."zappysys"
    
    ZappySys JDBC Bridge ODBC Driver - Select Table and Preview Data
  6. If you are using Direct ConnectionString method in other tool/code then just Click [Copy ConnectionString] button and hit cancel so we don't create DSN.
  7. If you are using DSN method then Click OK to save our DSN Configuration.
  8. Now, lets load data into Excel Sheet Using ODBC DSN.
  9. Open Microsoft Excel, In the Data Menu, select New Query, select From Other Sources and select From ODBC.
    ZappySys JDBC Bridge ODBC Driver : Load Data Into MS-Excel - Select ODBC Source
  10. Now, select DSN we have created and Enter or Copy a SQL Query from JDBC Bridge ODBC Driver and paste into SQL Statement.
    SELECT orderid, customerid, orderdate, orderamount
    FROM "public"."zappysys"
    
    ZappySys JDBC Bridge ODBC Driver : Load Data Into MS-Excel - Select DSN
  11. Click on OK button.
  12. Now, in the Windows Tab, select an appropriate credentials and click on Connect button.
    ZappySys ODBC Driver - Create Credentials
  13. Now, click on load and select Load To... for load data into Microsoft Excel.
    ZappySys JDBC Bridge ODBC Driver : Load Data Into MS-Excel - Select Table
  14. Select New Worksheet for the data should be loaded.
    ZappySys JDBC Bridge ODBC Driver : Load Data Into MS-Excel - Select Table
  15. Click on Load button to load data.
  16. You can verify your data.
    ZappySys JDBC Bridge ODBC Driver : Load Data Into MS-Excel - Success

    Access Driver inside SQL Server (T-SQL Code)

    Click here for steps to create, Loading data inside SQL Server (T-SQL).

    Access Driver inside Other Tools / Programming Languages

    Click here for App Integration (ETL, Reporting, Analytics).

    Click here Programming Languages.

    Enable Log for Java

    If you wish to enable log for Java related part you can perform the following steps.
    1. Go to ZappySys.Odbc.Jdbc folder in C:\Program Files (x86)\ZappySys\ZappySys ODBC PowerPack\JdbcBridgeDriverX64 or whatever folder you installed this driver.
    2. Create an empty file named JdbcBridge.properties and enter your log file path like below and save it
      app.logfile=JdbcBridge_log.txt
      OR
      app.logfile=c:\somefolder\JdbcBridge_log.txt
    3. Copy this file to 2 more folders C:\Program Files (x86)\ZappySys\ZappySys ODBC PowerPack\JdbcBridgeDriverX86 and C:\Program Files (x86)\ZappySys\ZappySys ODBC PowerPack\ZappySys.TdsServer.WindowsService
    4. Now you can do test connection on JDBC Bridge Driver UI and see new log file is created or not.

    Enable Log for ODBC

    To enable Log for ODBC side you can perform these steps. This file is different log than Java side log (mentioned in the previous section).

    Review Java crash error file

    Sometimes java.exe failed to launch and cannot make connection with ODBC Driver, in such case previous 2 log files may not reveal information. In rare case you have to go to error.txt found in the same path we created our JdbcBridge.properties so review that error.

    Articles

    Click here to see all articles for [CSV File / REST API Driver] category
    e=
    How to import Amazon MWS data into SQL Server (T-SQL)

    How to import Amazon MWS data into SQL Server (T-SQL)

    Introduction In our previous blog post we saw how to import rest API in SQL Server. Using same concepts lets look at how to import Amazon MWS Data into SQL Server. We will explore many techniques to call Amazon MWS API and learn how to automate Amazon MWS data extraction without doing any ETL. We […]

    -{


    Copyrights reserved. ZappySys LLC.