JDBC-ODBC Bridge Connector for JAVA
In this article you will learn how to integrate Using JDBC-ODBC Bridge Connector you will be able to connect, read, and write data from within JAVA. Follow the steps below to see how we would accomplish that. The driver mentioned above is part of ODBC PowerPack which is a collection of high-performance Drivers for various API data source (i.e. REST API, JSON, XML, CSV, Amazon S3 and many more). Using familiar SQL query language you can make live connections and read/write data from API sources or JSON / XML / CSV Files inside SQL Server (T-SQL) or your favorite Reporting (i.e. Power BI, Tableau, Qlik, SSRS, MicroStrategy, Excel, MS Access), ETL Tools (i.e. Informatica, Talend, Pentaho, SSIS). You can also call our drivers from programming languages such as JAVA, C#, Python, PowerShell etc. If you are new to ODBC and ZappySys ODBC PowerPack then check the following links to get started. |
Connect to JDBC-ODBC Bridge in other apps
|
Create Data Source in ZappySys Data Gateway based on JDBC Bridge Driver
-
Download and install ZappySys ODBC PowerPack.
-
Search for gateway in start menu and Open ZappySys Data Gateway:
-
Go to Users Tab to add our first Gateway user. Click Add; we will give it a name tdsuser and enter password you like to give. Check Admin option and click OK to save. We will use these details later when we create linked server:
-
Now we are ready to add a data source. Click Add, give data source a name (Copy this name somewhere, we will need it later) and then select Native - ZappySys JDBC Bridge Driver. Finally, click OK. And it will create the Data Set for it and open the ZS driver UI.
-
Now, we need JDBC Bridge Connection. Lets create it. 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 -
This example shows how to write simple SOQL query (JDBC Bridge Object Query Language). It uses WHERE clause. For more SOQL Queries click here.
SOQL is similar to database SQL query language but much simpler and many features you use in database query may not be supported in SOQL (Such as JOIN clause not supported). But you can use following Queries for Insert, Update, Delete and Upsert(Update or Insert record if not found).SELECT orderid, customerid, orderdate, orderamount FROM "public"."zappysys" -
Click OK to finish creating the data source
Read data in Java from the DSN
-
Java code to get the data:
"jdbc:sqlserver://localhost:5000;databasename=JdbC-OdbcBridgeDSN;user=tdsuser;password=test" -
When you run the code it will make the API call and read the data:
-
Here is Java program's code in text format:
//Step-1: Install ZappySys ODBC PowerPack and Configure Data Gateway //Step-2:Assuming the Microsoft SQL Server JDBC Driver is in below folder //C:\Program Files\Microsoft Jdbc Driver 6.0 for SQL Server\sqljdbc_6.0\enu\auth\x64 package padaone; import java.sql.*; public class zappy { public static void main(String[] args) { // Create a variable for the connection string. String connectionUrl = "jdbc:sqlserver://localhost:5000;databasename=JdbC-OdbcBridgeDSN;user=test;password=test"; // Declare the JDBC objects. Connection con = null; Statement stmt = null; ResultSet rs = null; try { // Establish the connection. Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); con = DriverManager.getConnection(connectionUrl); // Create and execute an SQL statement that returns some data. String SQL = "SELECT Country , SUM(UnitPrice * Quantity) Total " + "FROM value " + "GROUP BY Country " + "WITH (SRC='https://services.odata.org/V3/Northwind/Northwind.svc/Invoices?$format=json')"; stmt = con.createStatement(); rs = stmt.executeQuery(SQL); // Iterate through the data in the result set and display it. while (rs.next()) { System.out.println(rs.getString(1) + " " + rs.getString(2)); } } // Handle any errors that may have occurred. catch (Exception e) { e.printStackTrace(); } finally { if (rs != null) try { rs.close(); } catch (Exception e) {} if (stmt != null) try { stmt.close(); } catch (Exception e) {} if (con != null) try { con.close(); } catch (Exception e) {} } } }
Conclusion
In this article we discussed how to connect to JDBC-ODBC Bridge in JAVA and integrate data without any coding. Click here to Download JDBC-ODBC Bridge Connector for JAVA and try yourself see how easy it is. If you still have any question(s) then ask here or simply click on live chat icon below and ask our expert (see bottom-right corner of this page).
Download JDBC-ODBC Bridge Connector for JAVA
Documentation
More integrations
Other application integration scenarios for JDBC-ODBC Bridge
Other connectors for JAVA
Download JDBC-ODBC Bridge Connector for JAVA
Documentation
How to connect JDBC-ODBC Bridge in JAVA?
How to get JDBC-ODBC Bridge data in JAVA?
How to read JDBC-ODBC Bridge data in JAVA?
How to load JDBC-ODBC Bridge data in JAVA?
How to import JDBC-ODBC Bridge data in JAVA?
How to pull JDBC-ODBC Bridge data in JAVA?
How to push data to JDBC-ODBC Bridge in JAVA?
How to write data to JDBC-ODBC Bridge in JAVA?
How to POST data to JDBC-ODBC Bridge in JAVA?
Call JDBC-ODBC Bridge API in JAVA
Consume JDBC-ODBC Bridge API in JAVA
JDBC-ODBC Bridge JAVA Automate
JDBC-ODBC Bridge JAVA Integration
Integration JDBC-ODBC Bridge in JAVA
Consume real-time JDBC-ODBC Bridge data in JAVA
Consume real-time JDBC-ODBC Bridge API data in JAVA
JDBC-ODBC Bridge ODBC Driver | ODBC Driver for JDBC-ODBC Bridge | ODBC JDBC-ODBC Bridge Driver | SSIS JDBC-ODBC Bridge Source | SSIS JDBC-ODBC Bridge Destination
Connect JDBC-ODBC Bridge in JAVA
Load JDBC-ODBC Bridge in JAVA
Load JDBC-ODBC Bridge data in JAVA
Read JDBC-ODBC Bridge data in JAVA
JDBC-ODBC Bridge API Call in JAVA