找回密码
 加入我们
搜索
      
查看: 511|回复: 2

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

[复制链接]
发表于 2025-7-20 19:46 | 显示全部楼层 |阅读模式
本帖最后由 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.”

费解。
发表于 2025-7-20 20:19 | 显示全部楼层
这种事情你还是去谷歌搜一下或者问老外的AI,GROK, OPENAI什么的
发表于 2025-7-20 22:25 来自手机 | 显示全部楼层
看到标题盲猜就是driver的问题,文末的错误果然
跨系统的该前后分离就分离,该上docker就上docker,省事很多
您需要登录后才可以回帖 登录 | 加入我们

本版积分规则

Archiver|手机版|小黑屋|Chiphell ( 沪ICP备12027953号-5 )沪公网备310112100042806 上海市互联网违法与不良信息举报中心

GMT+8, 2025-7-22 14:19 , Processed in 0.007762 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2007-2024 Chiphell.com All rights reserved.

快速回复 返回顶部 返回列表