HANDS ON
For Customers and Partners
SAP Analytics Hands On Exercise
Data Acquisition from a JDBC
Connection
Brought to you by SAP Analytics Cloud – Product Management
Presenters - .....
Contents
Introduction...............................................................................................................................................2
Create a JDBC connection for an on-premise SAP Sybase SQL Anywhere database .....................................3
Create a model and import the data based on a freehand SQL query through the JDBC connection ...........6
Create a visualization and a story with the acquired data ......................................................................... 11
Introduction
Goal
In this hands-on workshop, you will create a JDBC connection in SAP Analytics Cloud to an on-premise
SAP Sybase SQL Anywhere database, create a model and import data from the database.
Background
SAP Analytics Cloud (SAC) allows for data acquisition through a JDBC connection from on-premise
databases including SAP Sybase SQL Anywhere database. The data is acquired and stored in SAP
Analytics Cloud. This exercise shows available functionality once the prerequisites are in place.
Prerequisites have already been installed and configured in the landscape.
Prerequisites
Setting up an SAP HANA Cloud Connector and SAP Analytics Cloud Agent is required to allow SAC to
acquire data from on-premise systems. For more information on prerequisites, please refer to the following
blog:
https://blogs.sap.com/2016/05/11/enable-sap-cloud-for-analytics-for-data-acquistion-from-on-
premise-systems/
Purpose
At the end of this exercise, you should be able to:
• Create a JDBC connection in SAP Analytics Cloud to an on-premise SAP Sybase SQL Anywhere
database.
• Create a model based on a freehand SQL Query and acquire the data from SAP Sybase SQL
Anywhere database into SAP Analytics Cloud
• Create a story and a visualization with the acquired data in SAP Analytics Cloud
Create a JDBC connection for an on-premise SAP Sybase SQL
Anywhere database
In this section, you will set up a JDBC connection from SAP Analytics Cloud to an on-
premise SAP Sybase SQL Anywhere database.
Action Screenshot
1. Using Chrome browser, enter
the SAP Analytics Cloud tenant
URL your instructor provided to
you and logon with your
assigned user id.
Note:
Replace the XXX in the
“USER_XXX” with your
assigned student number from
your instructor.
2. Click on the menu icon in the
top left. From the dropdown,
choose Connection.
3. From the top right hand icons,
choose the “+” icon to add a
new connection.
Action Screenshot
4. From the drop down menu
choose
Import Data Connection à
SQL Databases
5. Enter the SAP Sybase SQL
Anywhere Database
Connection details as follows:
(replace XXX with your
assigned student id)
Connection Name:
JDBC_Sybase_XXX
Description: JDBC Sybase SQL
Anywhere DB Connection XXX
Connection Type: Select “Sybase
SQL Anywhere 16” from the
dropdown menu
Server (host:port): Localhost:2638
Database: BI4_AUDIT
User Name: dba
Password: Welcome1
Click Create to create the
connection
4
Action Screenshot
6. You should now see your new
SAP Sybase SQL Anywhere
JDBC connection displayed in
the available connections list.
Next, you will create an
analytics model and acquire
data from the SAP Sybase SQL
Anywhere database through
the JDBC connection to SAP
Analytics Cloud.
5
Create a model and import the data based on a freehand SQL
query through the JDBC connection
Before importing data from SAP Sybase SQL Anywhere Database, it is important to
create a business-focused model for the data. This will include defining a query
based on SAP Sybase SQL Anywhere Database to control what data will be acquired
and then creating a model that will set the dimensions and measures you bring in.
Action Screenshot
7. Choose the menu icon on the top
left and select
+ Create à Model to create your
business data model.
8. Choose how to start your model
by selecting “Use a datasource”.
Action Screenshot
9. A menu will appear on the right,
choose “SQL Databases” as an
acquisition data source.
10. For the Connection Type: use
the dropdown to select the
“Sybase SQL Anywhere 16”.
For Connection Name, use the
dropdown to select the connection
you created in the previous steps,
for example, JDBC_Sybase_XXX
where XXX is your student id.
For the Query Name, use the
dropdown to choose “Create New
Query”.
7
Action Screenshot
11. You will now define your Query
details to control what data you
will bring in. A list of available SAP
Sybase SQL Anywhere Database
queries is displayed based on the
authorizations of the user dba that
was entered in the Sybase SQL
Anywhere Database connection.
In this example, we will acquire
SAP Sybase SQL Anywhere
database system objects
information by defining a
“Freehand SQL” query instead of
selecting from the available query
list.
Enter the following where XXX is
your assigned studnet id.
Query Name:
systemObjects_XXX
Description: system objects XXX
Select Data: select the radio
button “Freehand SQL”
Enter the SQL statement:
SELECT * FROM sys.syscatalog
Click Next.
12. A SQL query is made to the SAP
Sybase SQL Anywhere database
to retrieve the system objects
information of the database.
Click Done on the Preview screen
to load the data from the database
to SAP Analytics Cloud.
8
Action Screenshot
13. You will see that 8 dimensions will
be displayed as columns with
names:
creator
tname
dbspacename
tabletype
ncols
primary key
check
remarks
14. From the right pane, change the
Model Name to
systemObjectsFromJDBC_xxx
where XXX is your student id.
DO NOT CREATE THE MODEL
YET.
Check if there is any mapping
quality issue at the bottom of the
screen.
9
Action Screenshot
Create the model by clicking on
the Create Model button.
15. From the Create Model popup,
click the Create button.
16. The new model is now displayed
as part of the model list and the
acquired data can be used to
create visualizations.
Next, you will utilize the model
and acquired data for your
analytics requirements.
10
Create a visualization and a story with the acquired data
In this section, you will create a visualization and story with the acquired data from
SAP Sybase SQL Anywhere database. The purpose of the step is show that you can
consume data from a JDBC connection to an on-premise database in SAP Analytics
Cloud from analytics point of view.
Action Screenshot
17. From the top left menu icon,
choose +Create - Story from
the dropdown.
18. Add a Canvas Page to the
story.
11
Action Screenshot
19. Add a chart to the canvas.
20. For the data source, select the
model created in previous steps
from the dropdown.
It will be easier if you just type
your student ID in the search
box.
Click OK.
21. By default, a bar chart is
created. Set “ncols” for the
MEASURE, and “creator” for
the DIMENSIONS of the chart.
12
Action Screenshot
22. Click on the “Save” button and
select Save in the dropdown
menu.
23. Enter the story “Title” as
following:
JDBC_Sybase_System_Object
s_XXX
where XXX is your student ID.
24. You have successfully finished
the exercise.
© 2016 SAP SE or an SAP affiliate company. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express
permission of SAP SE or an SAP affiliate company. SAP and other SAP products and services mentioned herein as
well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in
Germany and other countries.
Please see http://www.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademark
information and notices.
13