{"id":7427,"date":"2024-11-14T11:29:36","date_gmt":"2024-11-14T03:29:36","guid":{"rendered":"https:\/\/fwq.ai\/blog\/7427\/"},"modified":"2024-11-14T11:29:36","modified_gmt":"2024-11-14T03:29:36","slug":"%e4%b8%ba%e4%bb%80%e4%b9%88-mysql-jdbc-%e4%be%9d%e8%b5%96%e5%9c%a8-maven-%e4%b8%ad%e8%a2%ab%e6%8c%87%e5%ae%9a%e4%b8%ba%e8%bf%90%e8%a1%8c%e6%97%b6%e8%8c%83%e5%9b%b4%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/7427\/","title":{"rendered":"\u4e3a\u4ec0\u4e48 MySQL JDBC \u4f9d\u8d56\u5728 Maven \u4e2d\u88ab\u6307\u5b9a\u4e3a\u8fd0\u884c\u65f6\u8303\u56f4\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173081304489624.jpg\" class=\"aligncenter\" title=\"\u4e3a\u4ec0\u4e48 MySQL JDBC \u4f9d\u8d56\u5728 Maven \u4e2d\u88ab\u6307\u5b9a\u4e3a\u8fd0\u884c\u65f6\u8303\u56f4\uff1f\u63d2\u56fe\" alt=\"\u4e3a\u4ec0\u4e48 MySQL JDBC \u4f9d\u8d56\u5728 Maven \u4e2d\u88ab\u6307\u5b9a\u4e3a\u8fd0\u884c\u65f6\u8303\u56f4\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u7406\u89e3 MySQL \u5728 Maven \u4e2d\u7684\u8fd0\u884c\u65f6\u4f9d\u8d56\u8303\u56f4<\/strong><\/p>\n<p>\u5728\u4f7f\u7528 Maven \u6784\u5efa Java \u9879\u76ee\u65f6\uff0c\u4f9d\u8d56\u5173\u7cfb\u7684\u8303\u56f4\u5341\u5206\u91cd\u8981\u3002\u672c\u6587\u5c06\u63a2\u8ba8\u4e3a\u4ec0\u4e48 MySQL JDBC \u4f9d\u8d56\u88ab\u6307\u5b9a\u4e3a\u8fd0\u884c\u65f6\u8303\u56f4\uff0c\u5e76\u5728\u8fd0\u884c\u65f6\u901a\u8fc7\u53cd\u5c04\u52a0\u8f7d\u3002<\/p>\n<p>Java \u4ee3\u7801\u901a\u5e38\u4f9d\u8d56\u4e8e JDBC \u63a5\u53e3\uff0c\u800c\u4e0d\u662f\u76f4\u63a5\u4f9d\u8d56\u4e8e\u7279\u5b9a\u6570\u636e\u5e93\u7684 JDBC \u9a71\u52a8\u3002\u5f53\u4f7f\u7528 MySQL \u65f6\uff0c\u6211\u4eec\u4f1a\u5728\u8fd0\u884c\u65f6\u4f7f\u7528\u53cd\u5c04\u52a0\u8f7d com..jdbc.Driver \u7c7b\uff0c\u5e76\u901a\u8fc7 JDBC \u63a5\u53e3\u4e0e MySQL \u6570\u636e\u5e93\u8fdb\u884c\u4ea4\u4e92\u3002<\/p>\n<p>\u56e0\u6b64\uff0cMySQL JDBC \u9a71\u52a8\u5e76\u975e\u7f16\u8bd1\u4f9d\u8d56\uff0c\u56e0\u4e3a\u5b83\u4e0d\u662f\u7f16\u8bd1\u65f6\u5fc5\u9700\u7684\u3002\u76f8\u53cd\uff0c\u5b83\u5c5e\u4e8e\u8fd0\u884c\u65f6\u4f9d\u8d56\uff0c\u53ea\u6709\u5728\u5e94\u7528\u7a0b\u5e8f\u6267\u884c\u65f6\u624d\u9700\u8981\u3002<\/p>\n<p>Maven \u4e2d\u7684\u8fd0\u884c\u65f6\u4f9d\u8d56\u8303\u56f4\u610f\u5473\u7740\u5305\u4f9d\u8d56\u5728\u7f16\u8bd1\u65f6\u4e0d\u4f1a\u5305\u542b\u5728\u7c7b\u8def\u5f84\u4e2d\u3002\u4f46\u662f\uff0c\u5728\u6253\u5305\u9636\u6bb5\uff0c\u5b83\u5c06\u5305\u542b\u5728\u9879\u76ee\u4e2d\u3002\u8fd9\u786e\u4fdd\u4e86\u4f9d\u8d56\u9879\u5728\u8fd0\u884c\u65f6\u53ef\u7528\uff0c\u4f46\u4e0d\u4f1a\u5728\u7f16\u8bd1\u65f6\u589e\u52a0\u9879\u76ee\u5927\u5c0f\u3002<\/p>\n<p>Compile \u8303\u56f4\u901a\u5e38\u8868\u793a\u7f16\u8bd1\u65f6\u9700\u8981\u4f9d\u8d56\uff0c\u800c Maven \u901a\u5e38\u5728\u7f16\u8bd1\u548c\u8fd0\u884c\u65f6\u90fd\u5c06\u5176\u5305\u62ec\u5728 fat JAR \u4e2d\u3002\u7136\u800c\uff0cRuntime \u8303\u56f4\u660e\u786e\u6307\u5b9a\u4ec5\u5728\u8fd0\u884c\u65f6\u9700\u8981\u4f9d\u8d56\u9879\uff0c\u8fd9\u6709\u52a9\u4e8e\u4fdd\u6301\u4ee3\u7801\u7684\u7075\u6d3b\u6027\u5e76\u4f18\u5316\u7f16\u8bd1\u65f6\u95f4\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u4e3a\u4ec0\u4e48 MySQL JDBC \u4f9d\u8d56\u5728 Maven \u4e2d\u88ab\u6307\u5b9a\u4e3a\u8fd0\u884c\u65f6\u8303\u56f4\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>\u7406\u89e3 MySQL \u5728 Maven \u4e2d\u7684\u8fd0\u884c\u65f6\u4f9d\u8d56\u8303\u56f4 \u5728\u4f7f\u7528 Maven \u6784\u5efa Java \u9879\u76ee\u65f6\uff0c\u4f9d\u8d56\u5173\u7cfb\u7684\u8303\u56f4\u5341\u5206\u91cd\u8981\u3002\u672c\u6587\u5c06\u63a2\u8ba8\u4e3a\u4ec0\u4e48 MySQL JDBC \u4f9d\u8d56\u88ab\u6307\u5b9a\u4e3a\u8fd0\u884c\u65f6\u8303\u56f4\uff0c\u5e76\u5728\u8fd0\u884c\u65f6\u901a\u8fc7\u53cd\u5c04\u52a0\u8f7d\u3002 Java \u4ee3\u7801\u901a\u5e38\u4f9d\u8d56\u4e8e JDBC \u63a5\u53e3\uff0c\u800c\u4e0d\u662f\u76f4\u63a5\u4f9d\u8d56\u4e8e\u7279\u5b9a\u6570\u636e\u5e93\u7684 JDBC \u9a71\u52a8\u3002\u5f53\u4f7f\u7528 MySQL \u65f6\uff0c\u6211\u4eec\u4f1a\u5728\u8fd0\u884c\u65f6\u4f7f\u7528\u53cd\u5c04\u52a0\u8f7d com..jdbc.Driver \u7c7b\uff0c\u5e76\u901a\u8fc7 JDBC \u63a5\u53e3\u4e0e MySQL \u6570\u636e\u5e93\u8fdb\u884c\u4ea4\u4e92\u3002 \u56e0\u6b64\uff0cMySQL JDBC \u9a71\u52a8\u5e76\u975e\u7f16\u8bd1\u4f9d\u8d56\uff0c\u56e0\u4e3a\u5b83\u4e0d\u662f\u7f16\u8bd1\u65f6\u5fc5\u9700\u7684\u3002\u76f8\u53cd\uff0c\u5b83\u5c5e\u4e8e\u8fd0\u884c\u65f6\u4f9d\u8d56\uff0c\u53ea\u6709\u5728\u5e94\u7528\u7a0b\u5e8f\u6267\u884c\u65f6\u624d\u9700\u8981\u3002 Maven \u4e2d\u7684\u8fd0\u884c\u65f6\u4f9d\u8d56\u8303\u56f4\u610f\u5473\u7740\u5305\u4f9d\u8d56\u5728\u7f16\u8bd1\u65f6\u4e0d\u4f1a\u5305\u542b\u5728\u7c7b\u8def\u5f84\u4e2d\u3002\u4f46\u662f\uff0c\u5728\u6253\u5305\u9636\u6bb5\uff0c\u5b83\u5c06\u5305\u542b\u5728\u9879\u76ee\u4e2d\u3002\u8fd9\u786e\u4fdd\u4e86\u4f9d\u8d56\u9879\u5728\u8fd0\u884c\u65f6\u53ef\u7528\uff0c\u4f46\u4e0d\u4f1a\u5728\u7f16\u8bd1\u65f6\u589e\u52a0\u9879\u76ee\u5927\u5c0f\u3002 Compile \u8303\u56f4\u901a\u5e38\u8868\u793a\u7f16\u8bd1\u65f6\u9700\u8981\u4f9d\u8d56\uff0c\u800c Maven \u901a\u5e38\u5728\u7f16\u8bd1\u548c\u8fd0\u884c\u65f6\u90fd\u5c06\u5176\u5305\u62ec\u5728 fat JAR \u4e2d\u3002\u7136\u800c\uff0cRuntime \u8303\u56f4\u660e\u786e\u6307\u5b9a\u4ec5\u5728\u8fd0\u884c\u65f6\u9700\u8981\u4f9d\u8d56\u9879\uff0c\u8fd9\u6709\u52a9\u4e8e\u4fdd\u6301\u4ee3\u7801\u7684\u7075\u6d3b\u6027\u5e76\u4f18\u5316\u7f16\u8bd1\u65f6\u95f4\u3002 \u4ee5\u4e0a\u5c31\u662f\u4e3a\u4ec0\u4e48 MySQL JDBC \u4f9d\u8d56\u5728 Maven \u4e2d\u88ab\u6307\u5b9a\u4e3a\u8fd0\u884c\u65f6\u8303\u56f4\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-7427","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7427","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=7427"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7427\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=7427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=7427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=7427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}