title: Pass values from one notebook to other - Databricks
body: <p>I am connecting to azure sql server from databricks and for that i am using jdbc connector</p>
  
  <pre><code>val jdbcUsername = "user1"
  val jdbcPassword = "pwd1"
  val jdbcHostname = "XXXXsqldevussc.database.windows.net" 
  val jdbcPort = 1111
  val jdbcDatabase ="XXXXacttrackdev"
  </code></pre>
  
  <p>I am creating the jdbc url as follows</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>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</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>How do i pass both the values using dbutils.notebook.exit. Thanks for the help</p>
  
  <p>Thanks !</p>