{"id":26145,"date":"2024-11-24T16:45:04","date_gmt":"2024-11-24T08:45:04","guid":{"rendered":"https:\/\/fwq.ai\/blog\/26145\/"},"modified":"2024-11-24T16:45:04","modified_gmt":"2024-11-24T08:45:04","slug":"mysql-%e4%be%9d%e8%b5%96%e5%a3%b0%e6%98%8e%e4%b8%ba-runtime%ef%bc%8c%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0%e6%95%b0%e6%8d%ae%e5%ba%93%e8%bf%9e%e6%8e%a5%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/26145\/","title":{"rendered":"MySQL \u4f9d\u8d56\u58f0\u660e\u4e3a Runtime\uff0c\u5982\u4f55\u5b9e\u73b0\u6570\u636e\u5e93\u8fde\u63a5\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173081485386624.jpg\" class=\"aligncenter\" title=\"MySQL \u4f9d\u8d56\u58f0\u660e\u4e3a Runtime\uff0c\u5982\u4f55\u5b9e\u73b0\u6570\u636e\u5e93\u8fde\u63a5\uff1f\u63d2\u56fe\" alt=\"MySQL \u4f9d\u8d56\u58f0\u660e\u4e3a Runtime\uff0c\u5982\u4f55\u5b9e\u73b0\u6570\u636e\u5e93\u8fde\u63a5\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u63a2\u7d22 MySQL \u4f9d\u8d56\u4e3a Runtime \u7684\u539f\u56e0<\/strong><\/p>\n<p>MySQL \u7684 Maven \u4f9d\u8d56\u88ab\u58f0\u660e\u4e3a Runtime\uff0c\u8fd9\u5f15\u53d1\u4e86\u4e00\u4e2a\u7591\u95ee\uff1a\u65e2\u7136\u6253\u5305\u65f6\u4e0d\u5305\u542b MySQL \u4f9d\u8d56\uff0c\u53d1\u5e03\u540e\u7684\u9879\u76ee\u5982\u4f55\u8fde\u63a5\u6570\u636e\u5e93\uff1f<\/p>\n<p>\u7406\u89e3\u8fd9\u4e2a\u95ee\u9898\u7684\u5173\u952e\u5728\u4e8e JDBC\uff08Java \u6570\u636e\u5e93\u8fde\u63a5\uff09\u7684\u5de5\u4f5c\u539f\u7406\u3002\u5728\u7f16\u7801\u65f6\uff0c\u6211\u4eec\u53ea\u4f9d\u8d56 JDBC \u63a5\u53e3\uff0c\u800c\u4e0d\u662f MySQL \u7279\u5b9a\u7684\u9a71\u52a8\u7a0b\u5e8f\u3002\u5728\u8fde\u63a5 MySQL \u65f6\uff0c\u6211\u4eec\u4f7f\u7528\u53cd\u5c04\u65b9\u6cd5 Class.forName \u5728\u8fd0\u884c\u65f6\u4ece ClassPath \u52a0\u8f7d MySQL JDBC \u9a71\u52a8\u7a0b\u5e8f\u3002<\/p>\n<p>\u968f\u540e\u7684\u8c03\u7528\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u7684\u662f JDBC \u63a5\u53e3\u800c\u4e0d\u662f MySQL \u4e13\u6709\u65b9\u6cd5\uff0c\u8fd9\u610f\u5473\u7740\u6211\u4eec\u6ca1\u6709\u5728\u7f16\u8bd1\u65f6\u76f4\u63a5\u4f9d\u8d56 MySQL JDBC \u9a71\u52a8\u7a0b\u5e8f\u3002\u56e0\u6b64\uff0cJDBC \u9a71\u52a8\u7a0b\u5e8f\u5c5e\u4e8e\u8fd0\u884c\u65f6\u4f9d\u8d56\uff08Runtime Scope\uff09\u3002<\/p>\n<p>Runtime \u4f9d\u8d56\u5728\u7f16\u8bd1\u65f6\u4e0d\u4f1a\u5f15\u5165 ClassPath\uff0c\u4f46\u4f1a\u5728\u6253\u5305\u65f6\u5f15\u5165\uff0c\u56e0\u6b64\u65e0\u9700\u62c5\u5fc3 JDBC \u9a71\u52a8\u7a0b\u5e8f\u7684\u7f3a\u5931\u3002<\/p>\n<p>\u603b\u7ed3\u4e00\u4e0b\uff0cMySQL \u4f9d\u8d56\u58f0\u660e\u4e3a Runtime \u7684\u539f\u56e0\u662f\uff1a<\/p>\n<ul>\n<li>\u7f16\u7801\u65f6\u4ec5\u4f9d\u8d56 JDBC \u63a5\u53e3\uff0c\u800c\u4e0d\u662f MySQL \u9a71\u52a8\u7a0b\u5e8f\u3002<\/li>\n<li>JDBC \u9a71\u52a8\u7a0b\u5e8f\u5728\u8fd0\u884c\u65f6\u4ece ClassPath \u52a0\u8f7d\uff0c\u7528\u4e8e\u8fde\u63a5\u6570\u636e\u5e93\u3002<\/li>\n<li>\u7f16\u8bd1\u65f6\u4f9d\u8d56 Compile Scope\uff0c\u901a\u5e38\u540c\u65f6\u662f\u8fd0\u884c\u65f6\u4f9d\u8d56\u3002<\/li>\n<li>\u67d0\u4e9b\u4f9d\u8d56\u53ef\u80fd\u4e3a CompileOnly Scope\uff0c\u5728\u7f16\u8bd1\u65f6\u9700\u8981\uff0c\u4f46\u8fd0\u884c\u65f6\u4e0d\u9700\u8981\uff08\u4f8b\u5982\u6ce8\u89e3\uff09\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662fMySQL \u4f9d\u8d56\u58f0\u660e\u4e3a Runtime\uff0c\u5982\u4f55\u5b9e\u73b0\u6570\u636e\u5e93\u8fde\u63a5\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22 MySQL \u4f9d\u8d56\u4e3a Runtime \u7684\u539f\u56e0 MySQL \u7684 Maven \u4f9d\u8d56\u88ab\u58f0\u660e\u4e3a Runtime\uff0c\u8fd9\u5f15\u53d1\u4e86\u4e00\u4e2a\u7591\u95ee\uff1a\u65e2\u7136\u6253\u5305\u65f6\u4e0d\u5305\u542b MySQL \u4f9d\u8d56\uff0c\u53d1\u5e03\u540e\u7684\u9879\u76ee\u5982\u4f55\u8fde\u63a5\u6570\u636e\u5e93\uff1f \u7406\u89e3\u8fd9\u4e2a\u95ee\u9898\u7684\u5173\u952e\u5728\u4e8e JDBC\uff08Java \u6570\u636e\u5e93\u8fde\u63a5\uff09\u7684\u5de5\u4f5c\u539f\u7406\u3002\u5728\u7f16\u7801\u65f6\uff0c\u6211\u4eec\u53ea\u4f9d\u8d56 JDBC \u63a5\u53e3\uff0c\u800c\u4e0d\u662f MySQL \u7279\u5b9a\u7684\u9a71\u52a8\u7a0b\u5e8f\u3002\u5728\u8fde\u63a5 MySQL \u65f6\uff0c\u6211\u4eec\u4f7f\u7528\u53cd\u5c04\u65b9\u6cd5 Class.forName \u5728\u8fd0\u884c\u65f6\u4ece ClassPath \u52a0\u8f7d MySQL JDBC \u9a71\u52a8\u7a0b\u5e8f\u3002 \u968f\u540e\u7684\u8c03\u7528\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u7684\u662f JDBC \u63a5\u53e3\u800c\u4e0d\u662f MySQL \u4e13\u6709\u65b9\u6cd5\uff0c\u8fd9\u610f\u5473\u7740\u6211\u4eec\u6ca1\u6709\u5728\u7f16\u8bd1\u65f6\u76f4\u63a5\u4f9d\u8d56 MySQL JDBC \u9a71\u52a8\u7a0b\u5e8f\u3002\u56e0\u6b64\uff0cJDBC \u9a71\u52a8\u7a0b\u5e8f\u5c5e\u4e8e\u8fd0\u884c\u65f6\u4f9d\u8d56\uff08Runtime Scope\uff09\u3002 Runtime \u4f9d\u8d56\u5728\u7f16\u8bd1\u65f6\u4e0d\u4f1a\u5f15\u5165 ClassPath\uff0c\u4f46\u4f1a\u5728\u6253\u5305\u65f6\u5f15\u5165\uff0c\u56e0\u6b64\u65e0\u9700\u62c5\u5fc3 JDBC \u9a71\u52a8\u7a0b\u5e8f\u7684\u7f3a\u5931\u3002 \u603b\u7ed3\u4e00\u4e0b\uff0cMySQL \u4f9d\u8d56\u58f0\u660e\u4e3a Runtime \u7684\u539f\u56e0\u662f\uff1a \u7f16\u7801\u65f6\u4ec5\u4f9d\u8d56 JDBC \u63a5\u53e3\uff0c\u800c\u4e0d\u662f MySQL \u9a71\u52a8\u7a0b\u5e8f\u3002 JDBC \u9a71\u52a8\u7a0b\u5e8f\u5728\u8fd0\u884c\u65f6\u4ece ClassPath [&hellip;]<\/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-26145","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/26145","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=26145"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/26145\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=26145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=26145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=26145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}