Establish JDBC Connection in R through single sign-on

0 votes

I am currently trying to connect to an Amazon Web Service database through the RJDBC package within R.

I have all the information about the driver, jarfile & URL needed in order to connect to the database, however the problem occurs with trying to get the username and password as access is given through a single sign-on site for which I get access to all other apps.

This is the current code setup I have to obtain connection to the database

jdbcConnection <- dbConnect(drv,

The credentials to access the sign on site itself does not work. Is it possible to use another method other than requiring:

 user = <>,
 password = <>)


Sep 12, 2018 in AWS by bug_seeker
• 15,550 points

1 answer to this question.

0 votes

You can certainly connect to databases with RJDBC using Single Sign-On (SSO). Here's an example how you could do so with Okta SSO and Snowflake.

# load library

# specify driver
jdbcDriver <- JDBC(driverClass="net.snowflake.client.jdbc.SnowflakeDriver", 
            classPath="/home/<your_username>/R/snowflake-jdbc-3.6.6.jar") # <-- this is where I saved the jar file

# create a connection
# this is the most critical part.
# you have to make sure you enter your SSO path as well as corp username with domain
con <- dbConnect(jdbcDriver, "jdbc:snowflake://", 
                    '', 'password')

# to query data
# at this point, you are good to go. start querying data.
dbGetQuery(con, "select current_timestamp() as now")
answered Sep 12, 2018 by Priyaj
• 58,120 points

Related Questions In AWS

0 votes
2 answers

How to access files in S3 bucket from R?

You can take a look at the ...READ MORE

answered Aug 10, 2018 in AWS by Deepthi
• 300 points
0 votes
1 answer

Can't find class CognitoUserPoolsSignInProvider: Issue with Sign In integration

CognitoUserPoolsSignInProvider is ditributed as part of aws-android-sdk-auth-userpools library. Please import ...READ MORE

answered Sep 28, 2018 in AWS by Priyaj
• 58,120 points
0 votes
1 answer
0 votes
1 answer

How to retrieve column names from java.sql.ResultSet?

You may refer the below code: ResultSet ...READ MORE

answered Jul 4, 2018 in Java by sophia
• 1,400 points
0 votes
1 answer

Find Oracle JDBC driver in Maven repository

Download the jar and place it in ...READ MORE

answered Sep 26, 2018 in Java by Daisy
• 8,110 points
0 votes
1 answer

Accessing connection from different class in Java / MySQL?

You should just instantiate DoComms with every ...READ MORE

answered Nov 14, 2018 in Database by nirvana
• 3,150 points
0 votes
1 answer

Error while connecting to Hive using Java JDBC

Use ​org.apache.hive.jdbc.HiveDriver as your driver ...READ MORE

answered Nov 21, 2018 in Big Data Hadoop by Omkar
• 69,150 points
+2 votes
1 answer
+1 vote
1 answer

How to authenticate session in application running on Beanstalk with boto3

The recommended way of managing credentials used ...READ MORE

answered Aug 28, 2018 in AWS by Priyaj
• 58,120 points