Aug 08 2022 04:17 PM - edited Aug 08 2022 04:49 PM
It works:
1. Win2019/2016 + SQL 2022
2. Win2022 + SQL 2019
It does not work:
1. Win2022 + SQL 2022
From wireshark it looked like not a Firewall issue.
netstat is showing: TCP 0.0.0.0:1433 WIN-392VVL443C0:0 LISTENING
JDBC URL: jdbc:sqlserver://WIN-392VVL443C0:1433;integratedSecurity=false
User Name: sa which is enabled
If I use cmd: SQLCMD.EXE -U sa -P XXX, it worked.
Exception when used JDBC driver by user name and password:
####
Aug 8, 2022 10:24:20 PM STDOUT: readJdbcParameters >> jdbcDriverClass: com.microsoft.sqlserver.jdbc.SQLServerDriver
Aug 8, 2022 10:24:20 PM STDOUT: DatabaseUtilities> initDataSource>> jdbcDriverClass: com.microsoft.sqlserver.jdbc.SQLServerDriver
Aug 8, 2022 10:25:53 PM LoggerUtilities STDERR: Exception:
com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset ClientConnectionId:0f82270f-45fa-4aa6-8878-0b38c3e8195c
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:3151)
at com.microsoft.sqlserver.jdbc.TDSChannel.read(IOBuffer.java:2062)
at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(IOBuffer.java:6596)
at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(IOBuffer.java:7762)
at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(IOBuffer.java:7725)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:5232)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:3988)
at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:3932)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7375)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:3206)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:2713)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:2362)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:2213)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1276)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:861)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)
at com.xxxx.scm.server.db.util.DBConnectionProxy.getConnectionFromDriverManager(DBConnectionProxy.java:414)
at com.xxxx.scm.server.db.util.MSJDBCDriver.getConnection(MSJDBCDriver.java:182)
at com.xxxx.scm.server.db.util.JDBCDriver.getDatabaseConnectionWithNTLMv2Retry(JDBCDriver.java:192)
at com.xxxx.scm.server.db.util.DatabaseUtilities.getDatabaseConnectionWithNTLMv2Retry(DatabaseUtilities.java:606)
at com.xxxx.scm.server.db.util.DatabaseUtilities.getDatabaseConnectionWithNTLMv2Retry(DatabaseUtilities.java:585)
at com.xxxx.scm.server.db.util.DbUtil.getDatabaseConnectionWithTlsCheck(DbUtil.java:2278)
at com.xxxx.scm.install.ui.SqlPropPanel.checkDBConnection(SqlPropPanel.java:2254)
at com.xxxx.scm.install.ui.SqlPropPanel.btnLoadPath_actionPerformed(SqlPropPanel.java:1875)
at com.xxxx.scm.install.ui.SqlPropPanel.lambda$jbInit$0(SqlPropPanel.java:416)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6635)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
at java.desktop/java.awt.Component.processEvent(Component.java:6400)
at java.desktop/java.awt.Container.processEvent(Container.java:2263)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5011)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.net.SocketException: Connection reset
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:186)
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
at com.microsoft.sqlserver.jdbc.TDSChannel.read(IOBuffer.java:2054)
... 59 more
Aug 14 2022 07:47 AM
@KevinWang2014 , I am having this exact same problem. I've just upgraded to CTP 2.1 in the hope that it would make a difference, bad sadly it didn't.
Did you end up solving the issue?
Aug 23 2022 08:25 AM
Yes, I also tested 2.1 and saw same problem. It should be a SQL Server bug. We have filled a defect to Microsoft by our company, I would let you know once we get feedback.
Aug 23 2022 09:30 AM - edited Aug 23 2022 04:01 PM
SolutionAs a workaround until it's fixed, try disabling TLS 1.3. Either in the server OS' registry
https://docs.microsoft.com/en-us/windows-server/security/tls/tls-registry-settings#tls-dtls-and-ssl-...
Or just in SQL Server by setting the global trace flag 11808. The trace flag will be effective only after service restart. So it’s better to specify it when the service starts with the switch -T11808. It will need to be set using SQL Server Configuration Manager so that it is applied on startup.
Aug 23 2022 12:26 PM
Aug 23 2022 04:02 PM
Aug 23 2022 04:38 PM
Aug 23 2022 07:48 PM
Aug 23 2022 09:30 AM - edited Aug 23 2022 04:01 PM
SolutionAs a workaround until it's fixed, try disabling TLS 1.3. Either in the server OS' registry
https://docs.microsoft.com/en-us/windows-server/security/tls/tls-registry-settings#tls-dtls-and-ssl-...
Or just in SQL Server by setting the global trace flag 11808. The trace flag will be effective only after service restart. So it’s better to specify it when the service starts with the switch -T11808. It will need to be set using SQL Server Configuration Manager so that it is applied on startup.