Using InterSystems Caché and Apache Zeppelin
Tags: intersystems
Published: 2021-04-25 09:08:35

I' have done some tests with Caché and Apache Zeppelin. I want to share my experince to use both systems together. I'll try to describe all steps that are required to config Zeppelin to connect to Caché.
 
## What is  Apache Zeppelin?

For all who think: What the heck is Apache Zeppelin? Here are some details what the [project site](http://zeppelin.apache.org) says:

*"A web-based notebook that enables interactive data analytics. You can make beautiful data-driven, interactive and collaborative documents with SQL, Scala and more. Apache Zeppelin interpreter concept allows any language/data-processing-backend to be plugged into Zeppelin. Currently Apache Zeppelin supports many interpreters such as Apache Spark, Python, JDBC, Markdown and Shell"*

Let's start
 
## Install Apache Zeppelin

The next 5 steps describe how to get Apache Zeppelin up and running:

1. You need a Java Runtime Environment. I you haven't download and install from [here](http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html)  
2. Download Zeppelin from [here](http://zeppelin.apache.org/download.html)  
3. Extract the entire Zeppelin Zip-File into a folder like d:\zeppelin  
4. Open a shell (cmd on windows) and navigate into the folder \zeppelin\bin  
5. Execute zeppelin.bat on Windows to start Zeppelin Open up a browser and use this url http://localhost:8080 to open the main page of zeppelin. You should see something like this: 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tgm69r2n0qa0275tx5wa.png)

**Well done! Zeppelin is now up and running!**

# Connect to Caché

Now let us introduce Caché. The next steps describe how to create a jdbc connection to a Caché Namespace.

1. Navigate to the menu item "anonymouse" -> "Interpreter" and scroll down to the "jdbc" section. 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p3zlia9d25az9ehr75z2.png)

2. Now press edit and go to the end of the jdbc section and enter your Caché JDBC connection string 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uhkl5tqd5gpdwzej4aq0.png)

```
cache.driver     = com.intersys.jdbc.CacheDriver 
cache.password   = ??? 
cache.url        = jdbc:Cache://<server\ip>:<port>/<namespace>
cache.user       = _SYSTEM

```  

3. Add the path to the Caché JDBC driver in the "Dependencies". This is located at the end of jdbc section. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3ld7ulwq8jxqvlz153m0.png)

4. Press SAVE

Great! All preparations are done, now let us use Zepplin and Caché.

# Query Caché

Follow these steps to create a first Notebook to query and visualize some Caché data.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lrzxidc0pa7vay5v4dqm.png)

Press **create new note** and name it like "HELLO WORLD" ...

By typing `%jdbc(cache)` you inform zeppelin what data source you want to query.
In detail: The `%jdbc` keyword lets zeppelin call the jdbc interpreter and the cache routes the query to the Caché connection. If you want to use more connections to Caché e.g. another namespace you have to create more entries in the jdbc section you've done before. The prefix of the entries are the connection name.

Ok now place a sql statement in the next line. After that press execute and you will immediately  see the result:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i8wkki7gb6wiw4udm6ao.png)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/js4z86yw6a11llrv6xma.png)

**Happy testing!**