Sly 发表于 2025-7-20 19:46

同样的Java程序去连接SQL Server,Windows和MacOS下,后者报错?

本帖最后由 Sly 于 2025-7-20 19:54 编辑

局域网里面有服务器、Windows电脑和mac电脑,均处于同一个网段下。

JDK 21.0.8版本一样,JDBC(MSSQL 12.10.1-jre11)驱动版本一样,
同一个Java程序(文件、源代码完全相同)试图连接服务器上的SQL Server数据库。

字符串也很简单:"jdbc:sqlserver://;serverName=10.*.*.*;port=1433;databaseName=***System;encrypt=optional;trustServerCertificate=true;";

在Windows完全正常,然而在macOS上报告“The driver received an unexpected pre-login response. Verify the connection properties and check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. This driver can be used only with SQL Server 2005 or later.”

费解。

jaycty 发表于 2025-7-20 20:19

这种事情你还是去谷歌搜一下或者问老外的AI,GROK, OPENAI什么的

碌木 发表于 2025-7-20 22:25

看到标题盲猜就是driver的问题,文末的错误果然
跨系统的该前后分离就分离,该上docker就上docker,省事很多
页: [1]
查看完整版本: 同样的Java程序去连接SQL Server,Windows和MacOS下,后者报错?