Thursday 15 June 2017

Connect to SAP HANA via JDBC

SAP HANA provides a driver that enables Java applications to connect to the SAP HANA database with the JDBC application programming interface (API).

 ◈  Procedure


1. Install the JDBC driver.

SAP HANA, JDBC, All SAP Modules

The driver (ngdbc.jar) is installed as part of the SAP HANA client installation and by default is located at:
  • C:\Program Files\sap\hdbclient\ on Microsoft Windows platforms
  • /usr/sap/hdbclient/ on Linux and UNIX platforms
2. Add ngdbc.jar to your classpath.

3. Write Java code to create a connection to the database and execute SQL commands. Use a connection string in the form of jdbc:sap://<server>:<port>[/?<options>]. For example:

jdbc:sap://myServer:30015/?autocommit=false

Specify one or more failover servers by adding additional hosts, as in the following example:

jdbc:sap://myServer:30015;failover1:30015;failover2:30015/?autocommit=false

To connect to a specific database, for example tdb1, use the databaseName parameter, as illustrated in the following code:

jdbc:sap://localhost:30013/?databaseName=tdb1&user=SYSTEM&password=manager

◈ Example


The following is an example of connecting to an SAP HANA server called myhdb, which was installed as instance 07, with user name myName and password mySecret. Make sure to change these for your system, and add the JDBC driver (ngdbc.jar) to your classpath.

import java.sql.*;
public class jdemo {
   public static void main(String[] argv) {
      Connection connection = null;
      try {          
         connection = DriverManager.getConnection(
            "jdbc:sap://myhdb:30715/?autocommit=false", "myName", "mySecret");          
      } catch (SQLException e) {
         System.err.println("Connection Failed:");
         System.err.println(e);
         return;
      }
      if (connection != null) {
         try {
            System.out.println("Connection to HANA successful!");
            Statement stmt = connection.createStatement();
            ResultSet resultSet = stmt.executeQuery("Select 'hello world' from dummy");
            resultSet.next();
            String hello = resultSet.getString(1);
            System.out.println(hello);
       } catch (SQLException e) {
          System.err.println("Query failed!");
       }
     }
   }
}

Saturday 10 June 2017

SAP Lumira 2.0 Deployment Patterns

We’ve talked a lot in this blog series about the benefits of using SAP Lumira 2.0, but what are the specific deployment patterns to maximize business value?

Lets go through the patterns from simplest to most involved:

1. SAP Lumira, discovery component only.
2. SAP Lumira, designer component + SAP Lumira Server for BI Platform.
3. SAP Lumira, discovery and designer components + SAP Lumira Server for BI Platform.

SAP Lumira, discovery component only


SAP Lumira, SAP Module, SAP All Modules, SAP Guides, SAP Certifications, SAP Learning

In a Lumira 2.0 discovery only deployment, only the Lumira discovery tool is deployed to the desktop. Business analysts and casual users use this to:

◉ Access data sources like Excel, relational data like Oracle, IBM DB2, SAP HANA, or big data like Amazon Redshift, Apache Spark, or Cloudera Impala.
◉ Manipulate, cleanse, and join data from these datasets.
◉ Create visualizations, stories, and infographics.
◉ Share the resulting LUMX file with other users of Lumira 2.0 discovery via email.

The license that enables this deployment pattern is SAP Lumira, desktop edition.

Advantages


◉ Simple to deploy – a desktop install.
◉ Easy to get started, especially for small customers.

Drawbacks


◉ Each user requires a desktop install which can be cumbersome for a large user population.
◉ LUMX file sharing is done via email or file shares and is not governed.
◉ No ability to use the SAP BusinessObjects Universe for secured business user access to relational data via the SAP BusinessObjects BI Platform.
◉ No ability to access data sources that are defined and managed in the SAP BusinessObjects BI Platform.

SAP Lumira, designer component + SAP Lumira Server for BI Platform


SAP Lumira, SAP Module, SAP All Modules, SAP Guides, SAP Certifications, SAP Learning

In this deployment model, only Lumira designer is used to create sophisticated enterprise dashboards and analytic applications.

The workflow starts on the desktop with the SAP Lumira designer component where the dashboard developer starts by creating a template either from scratch, or by using one of the existing predefined templates.

The Lumira designer component is based on the Eclipse framework and is a developer-centric tool. We have customers that deploy this tool to power users that sit in the line of business, but they are typically well supported with predefined templates created by IT, and additional training.

I like to explain the designer component as similar to good old Microsoft Visual Basic. You drag and drop some visual components to the canvas, and wire them up using a scripting language, which in this case is a subset of Javascript instead of Basic.

Because this is a developer centric tool, it has more of a learning curve than SAP Lumira discovery. And that’s ok, because they are both based on the same common runtime engine, file format, and data access stack, and both are designed to work together.

Once users create the LUMX file using the designer component, it is published to the SAP BusinessObjects BI Platform where it can be secured and shared with large user populations.

All subsequent modification of the LUMX file must happen using the desktop software.

This is equivalent to the workflow used today by SAP BusinessObjects Dashboards customers, and SAP BusinessObjects Design Studio 1.x customers.

There are many licenses that enable this deployment pattern, but they would all include SAP BusinessObjects Dashboards or Xcelsius Enterprise.

Advantages


◉ Enables the creation of sophisticated dashboards and analytic applications.
◉ End user consumption of analytic applications are governed and secured by the SAP BusinessObjects BI Platform.
◉ Includes powerful out-of-the-box templates to help customer get started quickly.
◉ Enables sharing with thousands of end users via the SAP BusinessObjects BI Platform.
◉ The Lumira 2.0 applications are very interactive and enable features like end-user charting modification, minimizing the need to modify the templates using the designer component.
◉ Enables mobile consumption using online connectivity back to the BI Platform.

Drawbacks


◉ All LUMX file creation and modification has to be done using the designer component on the desktop.
◉ The designer component has a developer-centric look and feel which can create a steep learning curve for less technical users.
◉ Mobile access is all online – offline access to designer applications is not supported.
◉ Mashing up of multiple data sources is not supported without the discovery component.
◉ Server installation is required to enable scale and governance.
◉ Not intended for self-service data discovery.

SAP Lumira, discovery and designer components + SAP Lumira Server for BI Platform


SAP Lumira, SAP Module, SAP All Modules, SAP Guides, SAP Certifications, SAP Learning

In this deployment pattern, the full power of SAP Lumira is realized.

By combining the user friendliness of the discovery component with the scripting power of the designer component, customers can accelerate their dashboard projects. Business users rapidly prototype the look and feel of the dashboard first in the Lumira discovery component, and then IT or power users open those LUMX files in the designer component to add more interactivity via scripting.

Also, IT can endorse the usage of the discovery desktop client to enable more agility among the business user community.

LUMX files can be published to the SAP BusinessObjects BI Platform for governance and sharing from either the discovery or designer component.

Data mashups are supported via the discovery component, which can then be leveraged in the designer component.  After making modifications to the LUMX file in designer, that same file can be re-opened in discovery to refresh the offline data..

The licenses that enable this capability have been sold since 2012, starting with the BA&T BusinessObjects BI Suite, SAP BusinessObjects BI Suite, and the current SAP BusinessObjects Enterprise license (professional and premium editions only – not standard). SAP BusinessObjects Edge licenses sold since 2014 also include these licenses.

Legacy BusinessObjects Enterprise Premium licenses purchased prior to 2012 do NOT include this functionality.

Advantages


◉ Includes all the advantages of the prior 2 patterns plus…
◉ Business users can help rapidly prototype dashboards.
◉ Organically created visualizations can be easily promoted to enterprise grade analytic applications.
◉ Both business users and IT/power users can promote LUMX files to the SAP BusinessObjects BI Platform from either the discovery or designer component.
◉ The discovery component can be used to create data mashups that provide the data for analytic applications in the designer component.
◉ Most visualizations created with the discovery component support offline access in the SAP BusinessObjects Mobile app.
◉ The discovery component supports end-user access to relational data from the SAP BusinessObjects Universe.
◉ LUMX files created with the discovery component can be modified directly on the SAP BusinessObjects BI Platform without any need for desktop software.
◉ The SAP BusinessObjects BI Platform can be used to create a brand new Lumira document from scratch – but only against HANA online data sources. No need to use any desktop software.

Drawbacks


◉ Once a LUMX document is edited using the designer component, it cannot be edited in the discovery component. The LUMX file can be opened in discovery and viewed, and the offline data can be refreshed using discovery – however the visualizations and stories cannot be modified. This restriction is planned to be lifted in a future release.
◉ Server installation is required to enable scale and governance.