<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Java SQL Driver Manager not working in Unity Catalog shared mode in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/java-sql-driver-manager-not-working-in-unity-catalog-shared-mode/m-p/75537#M34979</link>
    <description>&lt;P&gt;Pretty sure you can use the Spark driver for SQL Server on Shared UC clusters.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;More info here:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/sql/connect/spark/connector?view=sql-server-ver16" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/sql/connect/spark/connector?view=sql-server-ver16&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I do agree that you should rather use lakehouse federation, although you won't be able to do upserts in SQL this way. It can only do read operations.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Moving from Non-Isolation Shared to Shared usually comes with a lot of (legacy) code refactoring.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jun 2024 06:49:10 GMT</pubDate>
    <dc:creator>jacovangelder</dc:creator>
    <dc:date>2024-06-24T06:49:10Z</dc:date>
    <item>
      <title>Java SQL Driver Manager not working in Unity Catalog shared mode</title>
      <link>https://community.databricks.com/t5/data-engineering/java-sql-driver-manager-not-working-in-unity-catalog-shared-mode/m-p/75326#M34933</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;We are facing issue during establishing connection with Azure SQL server through JDBC to perform UPSERT operation into sql server. Please find the connection statement and exception received during run:&lt;/P&gt;&lt;P&gt;conn = spark._sc._jvm.java.sql.DriverManager.getConnection(url,propertis["username"],properties["password"])&lt;BR /&gt;statement = conn.createStaement(merge_query)&lt;BR /&gt;statement.execute()&lt;/P&gt;&lt;P&gt;statement.close()&lt;BR /&gt;conn.close()&lt;/P&gt;&lt;P&gt;But&amp;nbsp;we&amp;nbsp;are&amp;nbsp;getting&amp;nbsp;below&amp;nbsp;error:&lt;BR /&gt;Following code throwing an error:&amp;nbsp;py4j.security.Py4JSecurityException: Method public static java.sql.Connection java.sql.DriverManager.getConnection(java.lang.String) throws java.sql.SQLException is not whitelisted on class class java.sql.DriverManager&lt;/P&gt;&lt;P&gt;Kindly help.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2024 11:52:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/java-sql-driver-manager-not-working-in-unity-catalog-shared-mode/m-p/75326#M34933</guid>
      <dc:creator>sensanjoy</dc:creator>
      <dc:date>2024-06-21T11:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Java SQL Driver Manager not working in Unity Catalog shared mode</title>
      <link>https://community.databricks.com/t5/data-engineering/java-sql-driver-manager-not-working-in-unity-catalog-shared-mode/m-p/75523#M34978</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/34319"&gt;@sensanjoy&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Based on this stacktrace, the cluster used in this case looks as shared access mode with Unity Catalog enabled cluster to me.&lt;/P&gt;
&lt;P&gt;Shared access mode clusters do not allow such connections.&lt;/P&gt;
&lt;P&gt;This use case can be addressed by:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Using a single user cluster Or&lt;/LI&gt;
&lt;LI&gt;Considering the usage of Lakehouse Query Federation (&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/query-federation/" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/azure/databricks/query-federation/&lt;/A&gt;)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 04:05:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/java-sql-driver-manager-not-working-in-unity-catalog-shared-mode/m-p/75523#M34978</guid>
      <dc:creator>User16502773013</dc:creator>
      <dc:date>2024-06-24T04:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: Java SQL Driver Manager not working in Unity Catalog shared mode</title>
      <link>https://community.databricks.com/t5/data-engineering/java-sql-driver-manager-not-working-in-unity-catalog-shared-mode/m-p/75537#M34979</link>
      <description>&lt;P&gt;Pretty sure you can use the Spark driver for SQL Server on Shared UC clusters.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;More info here:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/sql/connect/spark/connector?view=sql-server-ver16" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/sql/connect/spark/connector?view=sql-server-ver16&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I do agree that you should rather use lakehouse federation, although you won't be able to do upserts in SQL this way. It can only do read operations.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Moving from Non-Isolation Shared to Shared usually comes with a lot of (legacy) code refactoring.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 06:49:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/java-sql-driver-manager-not-working-in-unity-catalog-shared-mode/m-p/75537#M34979</guid>
      <dc:creator>jacovangelder</dc:creator>
      <dc:date>2024-06-24T06:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: Java SQL Driver Manager not working in Unity Catalog shared mode</title>
      <link>https://community.databricks.com/t5/data-engineering/java-sql-driver-manager-not-working-in-unity-catalog-shared-mode/m-p/75544#M34981</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/82104"&gt;@User16502773013&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/102253"&gt;@jacovangelder&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is something interesting to know that&amp;nbsp;Lakehouse Federation does not support UPSERT(merge into...)!!&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/102253"&gt;@jacovangelder&lt;/a&gt;&amp;nbsp; I think with above approach(link shared by you) only support "append" and "overwrite", but the requirement here is to perform UPSERT (execute some custom sql).&lt;/P&gt;&lt;P&gt;There is one more way that can be done and its through pyodbc connection after installing odbc driver(odbc criver 17 for sql server). Not sure is there any drawback compared to JDBC but we can run the same code on shared mode.&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 24 Jun 2024 07:47:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/java-sql-driver-manager-not-working-in-unity-catalog-shared-mode/m-p/75544#M34981</guid>
      <dc:creator>sensanjoy</dc:creator>
      <dc:date>2024-06-24T07:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Java SQL Driver Manager not working in Unity Catalog shared mode</title>
      <link>https://community.databricks.com/t5/data-engineering/java-sql-driver-manager-not-working-in-unity-catalog-shared-mode/m-p/75566#M34987</link>
      <description>&lt;P&gt;Just thinking out loud: perhaps you can use a stored procedure to do the upsert and initiate the stored procedure using something like pyodbc. Lakehouse federation for sure can not write. They are read only connections.&amp;nbsp;&lt;BR /&gt;The shared access mode clusters are mostly limited to functionality inside of Databricks due to the security model they have.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 09:49:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/java-sql-driver-manager-not-working-in-unity-catalog-shared-mode/m-p/75566#M34987</guid>
      <dc:creator>jacovangelder</dc:creator>
      <dc:date>2024-06-24T09:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Java SQL Driver Manager not working in Unity Catalog shared mode</title>
      <link>https://community.databricks.com/t5/data-engineering/java-sql-driver-manager-not-working-in-unity-catalog-shared-mode/m-p/125826#M47534</link>
      <description>&lt;P&gt;Any update on this?&lt;BR /&gt;I am also facing same error&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jul 2025 08:38:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/java-sql-driver-manager-not-working-in-unity-catalog-shared-mode/m-p/125826#M47534</guid>
      <dc:creator>Karthikcv</dc:creator>
      <dc:date>2025-07-21T08:38:55Z</dc:date>
    </item>
  </channel>
</rss>

