is there a read only option in jdbc driver?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ03-06-2023 07:17 AM
Is there a "read only" option when using databricks sql using jdbc driver?
I'm looking for an equivalent to this:
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ03-08-2023 10:50 PM
Hi, You can refer to https://docs.databricks.com/external-data/jdbc.html#read-data-with-jdbc
Please let us know if this helps.
Also please tag @Debayanโ with your next response which will notify me, Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ03-09-2023 12:34 AM
@Debayan Mukherjeeโ Thanks for your reply - but I don't think this help my case:
I want to let my app's users to be able to query over my databricks sql server, with prevention of editing data.
Statements like drop, insert, delete, update, truncate, etc... should not be allowed in that context.
Perhaps I did not fully understand your suggestion...
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ03-11-2023 07:15 AM
@Nativ Issacโ I would suggest to use a PAT token created on behalf of a service principal and grant SELECT privilege only to the service principal to the targeted catalogs/schemas/tables. Thus you can restrict the access to the data using JDBC. Please refer to below docs on the same topic. Hope this helps.
https://docs.databricks.com/dev-tools/api/latest/token-management.html#operation/get-token
https://docs.databricks.com/data-governance/unity-catalog/manage-privileges/privileges.html
https://docs.databricks.com/archive/spark-sql-2.x-language-manual/grant.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ03-31-2023 02:57 AM
Hi @Nativ Issacโ
Hope everything is going great.
Just wanted to check in if you were able to resolve your issue. If yes, would you be happy to mark an answer as best so that other members can find the solution more quickly? If not, please tell us so we can help you.
Cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ03-31-2023 03:27 AM
Hello @Vartika Nainโ ,
Still struggling with this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ03-31-2023 03:38 AM
@Nativ Issacโ
Have you tried these steps?
- Create service principal
- Create a PAT token on behalf of the service of the service principal.
- Grant only READ privileges to the service principal on all catalogs.
- Use the service principal token to access the tables in JDBC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ04-02-2023 12:12 AM
Hello @John Lourduโ
Thanks for your reply!
Unfortunately, for my project purposes, I can't do your suggested solution:
The project I'm working on is getting credentials of a customer databricks sql server and can not create service accounts etc...
Getting the customer do your solution is not the best option for me: it's a large company so every interaction is a hassle in terms of bureaucracy and politics..
Therefore I'm looking for a software solution.
Hope we can figure this out..
Thanks!

