JAVA
PreviousNext

Step-By-Step

For detailed steps check this article

Example


//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 private static final String jdbcDriver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; //The JDBC connection URL to connect to ZappySys Data Gateway Service using SQL Server driver private staticfinalStringjdbcURL="jdbc:sqlserver://localhost:5000;databasename=MyGatewayDataSource;user=tdsuser;password=tds123;"; //Connect to the database Connection databaseConnection = DriverManager.getConnection(jdbcURL); System.out.println("Connected to ZappySys Data Gateway Service using Microsoft SQL Server JDBC driver"); //declare the statement object Statement sqlStatement = databaseConnection.createStatement(); ResultSet rs = sqlStatement.executeQuery("SELECT Country , SUM(UnitPrice * Quantity) Total " + "FROM value " + "GROUP BY Country " +"WITH(SRC='http://services.odata.org/V3/Northwind/Northwind.svc/Invoices?$format=json')"); while (rs.next()) { System.out.println("-----Fetching new row----\n"); System.out.println(rs.getString("Country") + "\n"); //System.out.println(rs.getString("Total") + "\n"); }

Articles

Click here to see all articles for [JAVA] category
How to connect Java to REST API (JSON / SOAP XML)

How to connect Java to REST API (JSON / SOAP XML)

Introduction In this new article, we will see how to connect Java to REST API using a simple connector. This ODBC driver allows connecting to REST API or a local file in Java using SQL queries. If you are familiar with SQL, you can easily access to REST API or JSON using simple SQL queries. This article mainly […]



Copyrights reserved. ZappySys LLC.