javasql-serverdockermssql-jdbc

How to connect Netbeans to microsoft sql server on mac


does anybody know how to connnect netbeans to a microsoft sql server on mac. I am currently running sql server for linux in docker for all my school tasks on win sql.

We got drivers for microsoft sql database and I have add them in netbeans(8.2) but I dont know how to connect my azure data studio (or server that i run on docker) to my aplication. Everybody else is on wins and that driver works great with netbeans (8.2) and ssms.

Does any of you know how to fix my problem or do I need to run wins for this to work.

Ty

edit: this is error log that I get when I run solution https://pastebin.pl/view/ab3472d4


Solution

  • Your question:

    How to connect Netbeans to Microsoft SQL Server on Mac

    Your stack traceback:

    com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'sa'. ClientConnectionId:99bbec4b-d242-485c-a5b7-3055277b7d0f
            at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:254)
            at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(tdsparser.java:258)
            at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:104)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:4772)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:3581)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(SQLServerConnection.java:81)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:3541)
            at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7240) ...
            at hr.algebra.dal.sql.SqlRepository.selectArticles(SqlRepository.java:137)
            at hr.algebra.UploadArticlesPanel.loadModel(UploadArticlesPanel.java:117)
            at hr.algebra.UploadArticlesPanel.init(UploadArticlesPanel.java:106)
            at hr.algebra.UploadArticlesPanel.<init>(UploadArticlesPanel.java:30)
            at hr.algebra.Zadatak01.configurePanels(Zadatak01.java:91)
            at hr.algebra.Zadatak01.<init>(Zadatak01.java:22)
            at hr.algebra.Zadatak01$1.run(Zadatak01.java:81)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756) ...
    

    Your REAL question:

    Q: Why is my JDBC app failing with a Login failed for user 'sa' error?

    A: Make sure your database is configured for SQL Server Authentication, and NOT "Windows Authentication", and make sure the "sa" password is correct.

    These links give additional information:

    This link also discusses Linux/Docker specific issues: