How to connect to Azure SQL with JDBC

前端 未结 3 1850
粉色の甜心
粉色の甜心 2020-12-12 01:16

I try to connect to Azure SQL with MS JDBC driver:

import java.sql.*;

public class ExampleSQLJDBC {

    public static void main(String[] args) {

        /         


        
3条回答
  •  北海茫月
    2020-12-12 01:48

    The problem was solved with these steps:

    1. Open terminal (/Applications/Utilities/Terminal)
    2. Run scutil --get HostName (case sensitive!)
    3. If hostname is not set or contains .local, run sudo scutil --set HostName "newname"
    4. Try JDBC Azure SQL Connection again - hostname change is effective immediately

    Source: https://youtrack.jetbrains.com/issue/JRE-221#comment=27-1826316

提交回复
热议问题