This site uses cookies to deliver our services. By using this site, you acknowledge that you have read and understand our Cookie and Privacy policy. Your use of Kontext website is subject to this policy. Allow Cookies and Dismiss

Connecting Apache Zeppelin to your SQL Server

329 views 0 comments last modified about 6 months ago Raymond Tang

SQL Server zeppelin

This page demonstrates the steps you need to connect to SQL Server in Zeppelin. There are many ways to implement this, for example SQL Server interpreters in GitHub. In this page, I am going to use the JDBC driver to connect to SQL Server instead of using third party interpreters.

For authentication, I am using database login (SQL Server authentication) instead of Windows login since my machine is not part of any domain. If you want to setup Kerberos authentication, please refer the following link about how to configure ktab file name and SPN:

Java Kerberos Authentication Configuration Sample & SQL Server Connection Practice

Prerequisites

If you have not installed Zeppelin, follow the link below to setup your local instance:

Install Zeppelin 0.7.3 in Windows

Java JDK is also required, which is included as part of the above installation guide.

Connect to SQL Server

Setup SQL Server account

In my machine, I’ve setup one SQL Server login in my local SQL Server instance:

Login: zeppelin

Password: zeppelin

The above credential is going to be used when setting up interpreter.

Setup interpreter

In Zeppelin website, click Interpreter menu.

image

Click create button.

Input the following:

  • Interpreter Name: tsql
  • Interpreter group: jdbc

image

Setup the following properties:

  • default.driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
  • default.password: zeppelin
  • default.url: jdbc:sqlserver://localhost
  • default.user : zeppelin
  • zeppelin.jdbc.auth.type: SIMPLE
  • artifact: com.microsoft.sqlserver:mssql-jdbc:6.5.1.jre8-preview

image
You can change the property values to your own environment setup.

For the artifact setting, you can use local lib file path or using groupid:artifact id:version. In my case, I am using the following SQL Server JDBC library.

https://search.maven.org/#artifactdetails%7Ccom.microsoft.sqlserver%7Cmssql-jdbc%7C6.5.1.jre8-preview%7Cjar

Click Save button to save this new interpreter.

Create note

Now you can create a new note with the new interpreter (%tsql).

The following is a sample code I use:

%tsql

select * from sys.all_objects where type='U'

The screenshot below shows the result:

image

Summary

It’s very easy to use JDBC to connect to SQL Server or any other JDBC compatible databases, for example, Oracle and Teradata.

Once you can connect to the database, you can then do analytics easily in Zeppelin.

Related pages

Install Zeppelin 0.7.3 in Windows

1238 views   6 comments last modified about 7 months ago

This post summarizes the steps to install Zeppelin 0.7.3 in Windows environment. Tools and Environment GIT Bash Command Prompt Windows 10 Download Binary Package Download the latest binary package from the following website: ...

View detail

Install Big Data Tools (Spark, Zeppelin, Hadoop) in Windows for Learning and Practice

586 views   2 comments last modified about 5 months ago

Are you a Windows/.NET developer and willing to learn big data concepts and tools in your Windows? If yes, you can follow the links below to install them in your PC. The installations are usually easier to do in Linux/UNIX but they are not difficult to implement in Windows either since the...

View detail

Read Text File from Hadoop in Zeppelin through Spark Context

1098 views   0 comments last modified about 7 months ago

Background This page provides an example to load text file from HDFS through SparkContext in Zeppelin (sc). Reference The details about this method can be found at: SparkContext.textFile ...

View detail

Add comment

Please login first to add comments.  Log in New user?  Register

Comments (0)

No comments yet.