{"id":6860,"date":"2024-11-14T10:17:15","date_gmt":"2024-11-14T02:17:15","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6860\/"},"modified":"2024-11-14T10:17:15","modified_gmt":"2024-11-14T02:17:15","slug":"springmvc-%e8%bf%9e%e6%8e%a5-mysql-%e9%81%87%e5%88%b0mysq%e9%94%99%e8%af%af%ef%bc%8c%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6860\/","title":{"rendered":"SpringMVC \u8fde\u63a5 MySQL \u9047\u5230\u201cmysq\u201d\u9519\u8bef\uff0c\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/172999856954263.jpg\" class=\"aligncenter\" title=\"SpringMVC \u8fde\u63a5 MySQL \u9047\u5230\u201cmysq\u201d\u9519\u8bef\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" alt=\"SpringMVC \u8fde\u63a5 MySQL \u9047\u5230\u201cmysq\u201d\u9519\u8bef\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>SpringMVC \u8fde\u63a5 MySQL \u65f6\u9047\u5230\u7684\u95ee\u9898\u548c\u89e3\u51b3\u65b9\u6848<\/strong><\/p>\n<p>\u5728\u914d\u7f6e SpringMVC \u8fde\u63a5 MySQL \u6570\u636e\u5e93\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u610f\u60f3\u4e0d\u5230\u7684\u95ee\u9898\uff0c\u4f8b\u5982\u5c06 &#8220;&#8221; \u9519\u5199\u4e3a &#8220;mysq&#8221;\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0cTomcat \u542f\u52a8\u4fe1\u606f\u53ef\u80fd\u4f1a\u505c\u6ede\uff0c\u4e14\u4e0d\u8f93\u51fa\u4efb\u4f55\u9519\u8bef\u4fe1\u606f\u3002<\/p>\n<p>\u8981\u89e3\u51b3\u6b64\u95ee\u9898\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u8fde\u63a5\u8d85\u65f6\u65f6\u95f4\uff0c\u4f8b\u5982 5 \u79d2\u3002\u5982\u679c\u5728\u6b64\u65f6\u95f4\u5185\u65e0\u6cd5\u83b7\u53d6\u8fde\u63a5\uff0c\u5219\u4f1a\u8f93\u51fa\u9519\u8bef\u4fe1\u606f\uff0c\u4f8b\u5982\u6570\u636e\u5e93\u4e0d\u5b58\u5728\u3002<\/p>\n<p>\u5177\u4f53\u5b9e\u73b0\u65b9\u6cd5\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u4e4b\u4e00\uff1a<\/p>\n<ul>\n<li>\u4f7f\u7528 init-method \u6216 @PostConstruct \u65b9\u6cd5<\/li>\n<li>\u5b9e\u73b0 InitializingBean \u63a5\u53e3<\/li>\n<li>\u4f7f\u7528\u963f\u91cc\u5df4\u5df4\u7684 Druid \u6570\u636e\u6e90<\/li>\n<\/ul>\n<p>\u5728\u4f7f\u7528\u4e0a\u8ff0\u65b9\u6cd5\u4e2d\u7684\u4e00\u79cd\u65f6\uff0c\u542f\u52a8\u8fc7\u7a0b\u5e94\u8be5\u4f1a\u62a5\u544a\u9519\u8bef\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fSpringMVC \u8fde\u63a5 MySQL \u9047\u5230\u201cmysq\u201d\u9519\u8bef\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SpringMVC \u8fde\u63a5 MySQL \u65f6\u9047\u5230\u7684\u95ee\u9898\u548c\u89e3\u51b3\u65b9\u6848 \u5728\u914d\u7f6e SpringMVC \u8fde\u63a5 MySQL \u6570\u636e\u5e93\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u610f\u60f3\u4e0d\u5230\u7684\u95ee\u9898\uff0c\u4f8b\u5982\u5c06 &#8220;&#8221; \u9519\u5199\u4e3a &#8220;mysq&#8221;\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0cTomcat \u542f\u52a8\u4fe1\u606f\u53ef\u80fd\u4f1a\u505c\u6ede\uff0c\u4e14\u4e0d\u8f93\u51fa\u4efb\u4f55\u9519\u8bef\u4fe1\u606f\u3002 \u8981\u89e3\u51b3\u6b64\u95ee\u9898\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u8fde\u63a5\u8d85\u65f6\u65f6\u95f4\uff0c\u4f8b\u5982 5 \u79d2\u3002\u5982\u679c\u5728\u6b64\u65f6\u95f4\u5185\u65e0\u6cd5\u83b7\u53d6\u8fde\u63a5\uff0c\u5219\u4f1a\u8f93\u51fa\u9519\u8bef\u4fe1\u606f\uff0c\u4f8b\u5982\u6570\u636e\u5e93\u4e0d\u5b58\u5728\u3002 \u5177\u4f53\u5b9e\u73b0\u65b9\u6cd5\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u4e4b\u4e00\uff1a \u4f7f\u7528 init-method \u6216 @PostConstruct \u65b9\u6cd5 \u5b9e\u73b0 InitializingBean \u63a5\u53e3 \u4f7f\u7528\u963f\u91cc\u5df4\u5df4\u7684 Druid \u6570\u636e\u6e90 \u5728\u4f7f\u7528\u4e0a\u8ff0\u65b9\u6cd5\u4e2d\u7684\u4e00\u79cd\u65f6\uff0c\u542f\u52a8\u8fc7\u7a0b\u5e94\u8be5\u4f1a\u62a5\u544a\u9519\u8bef\u3002 \u4ee5\u4e0a\u5c31\u662fSpringMVC \u8fde\u63a5 MySQL \u9047\u5230\u201cmysq\u201d\u9519\u8bef\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-6860","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6860","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=6860"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6860\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6860"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6860"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6860"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}