Databases - Connecting Spotfire Data Science to SAP Hana via JDBC

Databases - Connecting Spotfire Data Science to SAP Hana via JDBC

book

Article ID: KB0082711

calendar_today

Updated On:

Products Versions
Spotfire Data Science 6.x

Description

Connecting Spotfire Data Science to SAP Hana via JDBC

Issue/Introduction

Connecting Spotfire Data Science to SAP Hana via JDBC

Resolution

Connecting Spotfire Data Science to SAP Hana via JDBC

Follow the steps below to connect Spotfire Data Science to SAP Hana.

1. Copy the SAP Hana driver to the $CHORUS_HOME/shared/ALPINE_DATA_REPOSITORY/jdbc_driver/Public and $CHORUS_HOME/shared/libraries directories and change the ownership of these copies to the user who runs Spotfire Data Science (usually user 'chorus').

2. Create a new sap directory: $CHORUS_HOME/shared/ALPINE_DATA_REPOSITORY/jdbc/sap and copy the driver.properties file from $CHORUS_HOME/shared/ALPINE_DATA_REPOSITORY/jdbc/default directory to the newly created sap directory.
 

3. Edit the content of $CHORUS_HOME/shared/ALPINE_DATA_REPOSITORY/jdbc/sap/driver.properties file:

# Specify the JDBC class driver for the desired database type.
# Examples:
# Oracle = oracle.jdbc.driver.OracleDriver
# Greenplum = org.postgresql.Driver
# DB2 = com.ibm.db2.jcc.DB2Driver
# Netezza = org.netezza.Driver
# PostgreSQL = org.postgresql.Driver
# SQLServer = com.microsoft.sqlserver.jdbc.SQLServerDriver
# MySQL = com.mysql.jdbc.Driver
# Teradata = com.teradata.jdbc.TeraDriver
# Vertica = com.vertica.jdbc.Driver
# Sybase = com.sybase.jdbc2.jdbc.SybDriver
# Informix = com.informix.jdbc.IfxDriver
# SAPDB = com.sap.dbtech.jdbc.DriverSapDB
# InterBase = interbase.interclient.Driver
# HSqlDB = org.hsqldb.jdbcDriver
# MariaDB = org.mariadb.jdbc.Driver
# MySQL = com.mysql.jdbc.Driver
driverClass = com.sap.db.jdbc.Driver


4. Edit the content of additional_jdbc_drivers.rb file (with a path similar to this one: /usr/local/chorus/releases/5.9.1.0.3973-5d95f7c97/components/core/app/mixins/sequel/extensions/additional_jdbc_drivers.rb) and add a line for sap class so that the content looks similar to this:

module Sequel
  module AdditionalJdbcDrivers
    MAP =  {
        mariadb: ->(db) { org.mariadb.jdbc.Driver },
        teradata: ->(db) { com.teradata.jdbc.TeraDriver },
        vertica: ->(db) { com.vertica.jdbc.Driver },
        hive2: ->(db) { org.apache.hive.jdbc.HiveDriver },
        hive: ->(db) { org.apache.hadoop.hive.jdbc.HiveDriver },
        sap: ->(db) { com.sap.db.jdbc.Driver }
        }
 
    MAP.each do |key, driver|
      ::Sequel::JDBC::DATABASE_SETUP[key] = driver
    end
  end
end

Note: The change in additional_jdbc_drivers.rb file needs to be applied again after upgrading Spotfire Data Science.

5. Restart Spotfire Data Science and set the Data Connection using a similar URL (you can copy your SAP URL):

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