I am connecting to azure sql server from databricks and for that i am using jdbc connector
val jdbcUsername = "user1"
val jdbcPassword = "pwd1"
val jdbcHostname = "XXXXsqldevussc.database.windows.net"
val jdbcPort = 1111
val jdbcDatabase ="XXXXacttrackdev"
I am creating the jdbc url as follows
import java.util.Properties
val jdbc_url = s"jdbc:sqlserver://${jdbcHostname}:${jdbcPort};database=${jdbcDatabase};encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=60;"
val connectionProperties = new Properties()
connectionProperties.put("user", s"${jdbcUsername}")
connectionProperties.put("password", s"${jdbcPassword}")
val cP = connectionProperties
val driverClass = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
connectionProperties.setProperty("Driver", driverClass)
This is all in a notebook in a common folder and now i want to pass these values to a notebook in the project folder. Using dbutils.notebook.exit i am able to just pass one value (jdbc_url), but i need to pass connectionProperties as well to other notebook. Can somebody help me in doing this. I am trying to pass both the values in 2 separate dbutils.notebook.exit, but i get an error
dbutils.notebook.exit(jdbc_url) // works well
dbutils.notebook.exit(cP) //throws an error command-2330564045697042:1: error: type mismatch;
// found : java.util.Properties
// required: String
// dbutils.notebook.exit(cP)
How do i pass both the values using dbutils.notebook.exit. Thanks for the help
Thanks !