﻿{"id":1466,"date":"2023-07-20T12:24:42","date_gmt":"2023-07-20T04:24:42","guid":{"rendered":"http:\/\/blog.sway.com.cn\/?p=1466"},"modified":"2023-07-20T12:24:42","modified_gmt":"2023-07-20T04:24:42","slug":"%e5%85%b3%e4%ba%8espringboot%e8%bf%9e%e6%8e%a5mssql%e7%9a%84%e4%b8%80%e4%ba%9b%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/blog.sway.com.cn\/?p=1466","title":{"rendered":"\u5173\u4e8eSpringBoot\u8fde\u63a5MSSQL\u7684\u4e00\u4e9b\u95ee\u9898"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u60c5\u51b51\uff1a\u6ca1\u6709\u5f00\u542fTCP\/IP\u8fde\u63a5<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"152\" src=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image-1024x152.png\" alt=\"\" class=\"wp-image-1467\" srcset=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image-1024x152.png 1024w, http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image-300x44.png 300w, http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image-768x114.png 768w, http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image-1536x227.png 1536w, http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image.png 1553w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">com.microsoft.sqlserver.jdbc.SQLServerException: \u901a\u8fc7\u7aef\u53e3 1433 \u8fde\u63a5\u5230\u4e3b\u673a localhost \u7684 TCP\/IP \u8fde\u63a5\u5931\u8d25\u3002\u9519\u8bef:\u201cSocket operation on nonsocket: configureBlocking\u3002\u8bf7\u9a8c\u8bc1\u8fde\u63a5\u5c5e\u6027\u3002\u786e\u4fdd SQL Server \u7684\u5b9e\u4f8b\u6b63\u5728\u4e3b\u673a\u4e0a\u8fd0\u884c\uff0c\u4e14\u5728\u6b64\u7aef\u53e3\u63a5\u53d7 TCP\/IP \u8fde\u63a5\uff0c\u8fd8\u8981\u786e\u4fdd\u9632\u706b\u5899\u6ca1\u6709\u963b\u6b62\u5230\u6b64\u7aef\u53e3\u7684 TCP \u8fde\u63a5\u3002\u201d\u3002\n\tat com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:237)\n\tat com.microsoft.sqlserver.jdbc.SQLServerException.ConvertConnectExceptionToSQLServerException(SQLServerException.java:288)\n\tat com.microsoft.sqlserver.jdbc.SocketFinder.findSocket(IOBuffer.java:2720)\n\tat com.microsoft.sqlserver.jdbc.TDSChannel.open(IOBuffer.java:761)\n.....<\/pre>\n\n\n\n<p>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"981\" src=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image-1.png\" alt=\"\" class=\"wp-image-1468\" srcset=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image-1.png 969w, http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image-1-296x300.png 296w, http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image-1-768x778.png 768w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/><\/a><\/figure>\n\n\n\n<p>\u641c\u7d22SQL SERVER \u914d\u7f6e\u7ba1\u7406\u5668\uff0c\u542f\u7528\u5982\u4e0b\u56fe\u6240\u793a\u7684\u5730\u65b9\u5373\u53ef\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"795\" height=\"484\" src=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image-2.png\" alt=\"\" class=\"wp-image-1469\" srcset=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image-2.png 795w, http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image-2-300x183.png 300w, http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image-2-768x468.png 768w\" sizes=\"auto, (max-width: 795px) 100vw, 795px\" \/><\/a><figcaption class=\"wp-element-caption\">\u6ce8\u610f\uff1a\u4fee\u6539\u540e\u8981\u91cd\u542fSQL SERVER\u670d\u52a1\u624d\u80fd\u751f\u6548\u3002<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u60c5\u51b5\u4e8c\uff1a\u5b89\u5168\u8fde\u63a5\u4e0d\u901a\u8fc7<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image-3.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"240\" src=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image-3-1024x240.png\" alt=\"\" class=\"wp-image-1470\" srcset=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image-3-1024x240.png 1024w, http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image-3-300x70.png 300w, http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image-3-768x180.png 768w, http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image-3-1536x360.png 1536w, http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/07\/image-3.png 1754w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">com.microsoft.sqlserver.jdbc.SQLServerException: \u9a71\u52a8\u7a0b\u5e8f\u65e0\u6cd5\u901a\u8fc7\u4f7f\u7528\u5b89\u5168\u5957\u63a5\u5b57\u5c42(SSL)\u52a0\u5bc6\u4e0e SQL Server \u5efa\u7acb\u5b89\u5168\u8fde\u63a5\u3002\u9519\u8bef:\u201csun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target\u201d\u3002 ClientConnectionId:cae7aed5-1127-4c7e-a992-e9f2a379fd94\n\tat com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:3680)\n\tat com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:2113)\n\tat com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:3204)\n\tat com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:2833)\n\tat com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:2671)\n\tat com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1640)\n......<\/pre>\n\n\n\n<p>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<p>\u539f\u6765\u7684\u8fde\u63a5url\u662f\u8fd9\u6837\u5199\u7684\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">url: jdbc:sqlserver:\/\/localhost:1433;DatabaseName=csr-vwork<\/pre>\n\n\n\n<p>\u9700\u8981\u6539\u6210\u4ee5\u4e0b\u4e24\u79cd\u4e4b\u4e00\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">                url: jdbc:sqlserver:\/\/localhost:1433;DatabaseName=csr-vwork;encrypt=false\n                url: jdbc:sqlserver:\/\/localhost:1433;DatabaseName=csr-vwork;encrypt=true;trustServerCertificate=true<\/pre>\n\n\n\n<p>\u8fd9\u4e2a\u662f\u56e0\u4e3asqlever\u5728jdbc\u8fde\u63a5\u7684\u65f6\u5019\u9700\u8981\u4e00\u5b9a\u7684\u5b89\u5168\u9a8c\u8bc1\uff0c\u6211\u4eec\u8df3\u8fc7\u6216\u8005\u5f3a\u5236\u53ef\u4fe1\u5373\u53ef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u60c5\u51b51\uff1a\u6ca1\u6709\u5f00\u542fTCP\/IP\u8fde\u63a5 \u89e3\u51b3\u65b9\u6cd5\uff1a \u641c\u7d22SQL SERVER \u914d\u7f6e\u7ba1\u7406\u5668\uff0c\u542f\u7528\u5982\u4e0b\u56fe\u6240\u793a\u7684\u5730\u65b9\u5373\u53ef\uff1a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1466","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/1466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1466"}],"version-history":[{"count":1,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/1466\/revisions"}],"predecessor-version":[{"id":1471,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/1466\/revisions\/1471"}],"wp:attachment":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1466"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}