{"id":36950,"date":"2025-05-13T01:03:54","date_gmt":"2025-05-12T17:03:54","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/36950.html"},"modified":"2025-05-13T01:03:54","modified_gmt":"2025-05-12T17:03:54","slug":"jdbc%ef%bc%9ajava%e4%b8%8e%e6%95%b0%e6%8d%ae%e5%ba%93%e8%bf%9e%e6%8e%a5mavenmybatis","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/36950.html","title":{"rendered":"JDBC\uff1ajava\u4e0e\u6570\u636e\u5e93\u8fde\u63a5,Maven,MyBatis"},"content":{"rendered":"<h2>JDBC<\/h2>\n<p>\u662f\u4f7f\u7528Java\u8bed\u8a00\u64cd\u4f5c\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7684\u4e00\u5957API<\/p>\n<p>JDBC\u662f\u63a5\u53e3&#xff0c;\u7528\u5176\u5b9e\u73b0\u4e00\u7cfb\u5217\u4e0d\u540c\u79cd\u7c7b\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7684\u5b9e\u73b0\u7c7b<\/p>\n<h3>JDBC\u672c\u8d28:<\/h3>\n<p>\u00b7\u5b98\u65b9(sun\u516c\u53f8)\u5b9a\u4e49\u7684\u4e00\u5957\u64cd\u4f5c\u6240\u6709\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7684\u89c4\u5219&#xff0c;\u5373\u63a5\u53e3<\/p>\n<p>\u00b7\u5404\u4e2a\u6570\u636e\u5e93\u5382\u5546\u53bb\u5b9e\u73b0\u8fd9\u5957\u63a5\u53e3&#xff0c;\u63d0\u4f9b\u6570\u636e\u5e93\u9a71\u52a8jar\u5305<\/p>\n<p>\u00b7\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u8fd9\u5957\u63a5\u53e3(JDBC)\u7f16\u7a0b&#xff0c;\u771f\u6b63\u6267\u884c\u7684\u4ee3\u7801\u662f\u9a71\u52a8jar\u5305\u4e2d\u7684\u5b9e\u73b0\u7c7b<\/p>\n<h3>JDBC\u597d\u5904&#xff1a;<\/h3>\n<p>\u00b7\u5404\u79cd\u6570\u636e\u5e93\u5382\u5546\u4f7f\u7528\u76f8\u540c\u7684\u63a5\u53e3&#xff0c;java\u4ee3\u7801\u4e0d\u9700\u8981\u9488\u5bf9\u4e0d\u540c\u7684\u6570\u636e\u5e93\u5206\u522b\u5f00\u53d1<\/p>\n<p>\u00b7\u53ef\u968f\u65f6\u66ff\u6362\u5e95\u5c42\u6570\u636e\u5e93&#xff0c;\u8bbf\u95ee\u6570\u636e\u5e93\u7684java\u4ee3\u7801\u57fa\u672c\u4e0d\u53d8<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"872\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512170345-682229f1e2e63.png\" width=\"1138\" \/><\/p>\n<h3>\u4f7f\u7528&#xff1a; \u00a0<\/h3>\n<h4>DriverManager<\/h4>\n<p>\u00b7DriverManager&#xff08;\u9a71\u52a8\u7ba1\u7406\u7c7b&#xff09;\u4f5c\u7528&#xff1a; 1\u00b7\u6ce8\u518c\u9a71\u52a8<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"812\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512170346-682229f252aa4.png\" width=\"1250\" \/><\/p>\n<p>2\u00b7\u83b7\u53d6\u6570\u636e\u5e93\u8fde\u63a5<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"712\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512170346-682229f2b1434.png\" width=\"1797\" \/><\/p>\n<h4>Connection<\/h4>\n<p>\u00b7Connection&#xff08;\u6570\u636e\u5e93\u8fde\u63a5\u5bf9\u8c61&#xff09;\u4f5c\u7528&#xff1a;<\/p>\n<h5>1\u00b7\u83b7\u53d6\u6267\u884cSQL\u7684\u5bf9\u8c61<\/h5>\n<p>\u00a0\u00a0<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"738\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512170347-682229f334863.png\" width=\"1409\" \/><\/p>\n<h5>2\u00b7\u7ba1\u7406\u4e8b\u52a1<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"771\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512170347-682229f380f24.png\" width=\"1855\" \/><\/p>\n<p>\u5f00\u542f\u548c\u5173\u95ed\u4e8b\u7269\u7684\u5177\u4f53\u5b9e\u73b0&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"919\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512170348-682229f40fc5b.png\" width=\"940\" \/><\/p>\n<h4>Statement<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"583\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512170348-682229f44fda4.png\" width=\"1668\" \/><\/p>\n<p>\u6267\u884cUpdate\u8bed\u53e5\u7684\u5b9e\u4f8b&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"362\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512170348-682229f4b62c5.png\" width=\"1043\" \/><\/p>\n<h4>ResultSet<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"933\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512170348-682229f4e2a26.png\" width=\"1509\" \/><\/p>\n<h4>PreparedStatement<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"341\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512170349-682229f5544c2.png\" width=\"1782\" \/><\/p>\n<h5>SQL\u6ce8\u5165\u7684\u4f8b\u5b50&#xff1a;<\/h5>\n<p>\u5c06pwd\u5199\u6210<\/p>\n<p>&#039;&#039; or &#039;1&#039; &#061; &#039;1&#039;;<\/p>\n<p>\u5c31\u66f4\u6539\u4e86sql\u8bed\u53e5&#xff0c;\u5c06\u5176\u53d8\u4e3a<\/p>\n<p>select * from tb_user where username &#061; name and password &#061; &#039;&#039; or &#039;1&#039; &#061; &#039;1&#039;;<\/p>\n<p>\u00a0\u5148\u6267\u884cand\u8bed\u53e5\u7136\u540e\u518d\u662for\u8bed\u53e5<\/p>\n<p>\u8fd9\u6837\u65e0\u8bba\u5982\u4f55where \u540e\u9762\u7684\u8bed\u53e5\u90fd\u4f1a\u7b49\u4e8etrue\u5c31\u4f1a\u67e5\u8be2\u6240\u6709\u8bed\u53e5&#xff0c;\u8fd9\u6837\u4f7f\u7528resultSet.next()\u65f6\u5c31\u4f1a\u5b58\u5728\u8fd9\u6837\u7684\u7528\u6237&#xff0c;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"178\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512170349-682229f591176.png\" width=\"1490\" \/><\/p>\n<p>\u4f7f\u7528&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"930\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512170349-682229f5af70a.png\" width=\"1584\" \/><\/p>\n<h5>\u4f7f\u7528<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"470\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512170350-682229f661e34.png\" width=\"1002\" \/><\/p>\n<h5>\u539f\u7406<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"995\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512170350-682229f682e60.png\" width=\"2006\" \/><\/p>\n<p>\u5982\u679c\u5f00\u542f\u9884\u7f16\u8bd1\u529f\u80fd&#xff0c;\u9884\u7f16\u8bd1\u53d1\u751f\u7684\u65f6\u5019\u5c31\u662f\u5728\u521b\u5efaPreparedStatement\u5bf9\u8c61\u7684\u65f6\u5019&#xff0c;\u53ea\u9700\u8981PreparedStatement\u53ea\u9700\u8981\u7f16\u8bd1\u4e00\u6b21&#xff0c;\u540e\u7eed\u7684\u4ee3\u7801\u8981\u6539\u53d8SQL\u8bed\u53e5&#xff0c;\u5c31\u53ea\u8981\u6539\u53d8\u5360\u4f4d\u7b26\u4e2d\u7684\u5185\u5bb9&#xff0c;\u5c31\u4e0d\u4f1a\u518d\u7f16\u8bd1\u4e00\u6b21\u3002\u63d0\u9ad8\u6548\u7387\u3002<\/p>\n<h3>\u6570\u636e\u5e93\u8fde\u63a5\u6c60<\/h3>\n<h4>\u7b80\u4ecb&#xff1a;<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"895\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512170351-682229f730ee7.png\" width=\"2103\" \/><\/p>\n<h4>\u4f7f\u7528&#xff1a;<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"790\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512170352-682229f825cb6.png\" width=\"1873\" \/><\/p>\n<h4>Dirud\u8fde\u63a5\u6c60\u7684\u4f7f\u7528\u6b65\u9aa4<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"537\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512170352-682229f8a2e8a.png\" width=\"1593\" \/><\/p>\n<p>\u5b9e\u4f8b&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"694\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512170353-682229f909253.png\" width=\"1355\" \/><\/p>\n<h2>Maven<\/h2>\n<h3>\u6982\u51b5<\/h3>\n<p>Maven\u662f\u4e13\u95e8\u7528\u4e8e\u7ba1\u7406\u548c\u6784\u5efaJava\u9879\u76ee\u7684\u5de5\u5177&#xff0c;\u5b83\u7684\u4e3b\u8981\u529f\u80fd\u6709&#xff1a;<\/p>\n<p>\u00b7\u63d0\u4f9b\u4e86\u4e00\u5957\u6807\u51c6\u5316\u7684\u9879\u76ee\u7ed3\u6784<\/p>\n<p>\u00b7\u63d0\u4f9b\u4e86\u4e00\u5957\u6807\u51c6\u5316\u7684\u6784\u5efa\u6d41\u7a0b&#xff08;\u7f16\u8bd1&#xff0c;\u6d4b\u8bd5\u6253\u5305&#xff0c;\u53d1\u5e03&#8230;..)<\/p>\n<p>\u00b7\u63d0\u4f9b\u4e86\u4e00\u5957\u4ee5\u6765\u7ba1\u7406\u673a\u5236<\/p>\n<h4>\u6807\u51c6\u5316\u7684\u9879\u76ee\u7ed3\u6784<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"171\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512170353-682229f95a379.png\" width=\"1900\" \/><\/p>\n<h5>Maven\u9879\u76ee\u76ee\u5f55\u7684\u5b9e\u4f8b&#xff1a;<\/h5>\n<p>Maven\u63d0\u4f9b\u4e86\u4e00\u5957\u6807\u51c6\u5316\u7684\u9879\u76ee\u7ed3\u6784&#xff0c;\u6240\u6709IDE\u4f7f\u7528Maven\u6784\u5efa\u7684\u9879\u76ee\u7ed3\u6784\u5b8c\u5168\u4e00\u6837&#xff0c;\u6240\u6709IDE\u521b\u5efa\u7684Maven\u9879\u76ee\u53ef\u4ee5\u901a\u7528<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"495\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512170353-682229f98acd3.png\" width=\"1920\" \/><\/p>\n<h4>\u63d0\u4f9b\u4e86\u4e00\u5957\u6807\u51c6\u5316\u7684\u6784\u5efa\u6d41\u7a0b&#xff08;\u7f16\u8bd1&#xff0c;\u6d4b\u8bd5\u6253\u5305&#xff0c;\u53d1\u5e03&#8230;..)<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"396\" src=\"2025-05-130rb1i0t3dau.png\" width=\"1676\" \/><\/p>\n<h4>\u4f9d\u8d56\u7ba1\u7406\u673a\u5236<\/h4>\n<p>\u4f9d\u8d56\u7ba1\u7406\u5176\u5b9e\u5c31\u662f\u7ba1\u7406\u4f60\u9879\u76ee\u6240\u4f9d\u8d56\u7684\u7b2c\u4e09\u65b9\u8d44\u6e90(jar\u5305\u3001\u63d2\u4ef6&#8230;)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"571\" src=\"2025-05-13i2ie4utkucg.png\" width=\"2010\" \/><\/p>\n<h3>\u7b80\u4ecb&#xff1a;<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"278\" src=\"2025-05-132fpcimh3ee3.png\" width=\"1342\" \/><\/p>\n<h4>Maven\u6a21\u578b<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"525\" src=\"2025-05-1342l3qoqhrbf.png\" width=\"2146\" \/><\/p>\n<h5>\u4ed3\u5e93\u7684\u5206\u7c7b<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"311\" src=\"2025-05-13oqow5uatgmg.png\" width=\"833\" \/><\/p>\n<h5>\u5bfc\u5165jar\u5305\u7684\u8fc7\u7a0b<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"175\" src=\"2025-05-13dhqxutgjb2u.png\" width=\"1099\" \/><\/p>\n<h3>Maven\u5e38\u7528\u547d\u4ee4<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"414\" src=\"2025-05-13x35qo3u0lki.png\" width=\"532\" \/><\/p>\n<h3>Maven\u7684\u751f\u547d\u5468\u671f<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"683\" src=\"2025-05-13ayvkox0h3s2.png\" width=\"1755\" \/><\/p>\n<h3>Maven\u7684\u5750\u6807\u8be6\u89e3<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"495\" src=\"2025-05-13gjteil2eng0.png\" width=\"1913\" \/><\/p>\n<p>Maven\u5bfc\u5165Maven\u9879\u76ee<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"372\" src=\"2025-05-13qjaxibr2yu5.png\" width=\"752\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1368\" src=\"2025-05-13fj203nkcsfi.png\" width=\"2560\" \/><\/p>\n<h3>\u4f9d\u8d56\u7ba1\u7406<\/h3>\n<h4>\u4f7f\u7528\u5750\u6807\u5bfc\u5165jar\u5305<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"303\" src=\"2025-05-13ncxrbeyekwi.png\" width=\"1173\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"216\" src=\"2025-05-135jlodpcmuov.png\" width=\"671\" \/><\/p>\n<h4>\u5feb\u6377\u65b9\u6cd5<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"113\" src=\"2025-05-131vvfsnbg1ou.png\" width=\"470\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"450\" src=\"2025-05-13qxftyr4gwt0.png\" width=\"349\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"550\" src=\"2025-05-13u3ikqua0p0l.png\" width=\"772\" \/><\/p>\n<h3>\u4f9d\u8d56\u8303\u56f4<\/h3>\n<p>\u901a\u8fc7\u8bbe\u7f6e\u5750\u6807\u7684\u4f9d\u8d56\u8303\u56f4(scope)&#xff0c;\u53ef\u4ee5\u8bbe\u7f6e\u5bf9\u5e94jar\u5305\u7684\u4f5c\u7528\u8303\u56f4:\u7f16\u8bd1\u73af\u5883\u3001\u6d4b\u8bd5\u73af\u5883\u3001\u8fd0\u884c\u73af\u5883<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"267\" src=\"2025-05-13myacfhkvp5s.png\" width=\"716\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"449\" src=\"2025-05-13urenqgcola0.png\" width=\"1442\" \/><\/p>\n<h3>MyBatis<\/h3>\n<p>MyBatis\u662f\u4e00\u6b3e\u4f18\u79c0\u7684\u6301\u4e45\u5c42\u6846\u67b6&#xff0c;\u7528\u4e8e\u7b80\u5316JDBC\u5f00\u53d1<\/p>\n<p>MyBatis\u672c\u662fApache\u7684\u4e00\u4e2a\u5f00\u6e90\u9879\u76eeiBatis&#xff0c;2010\u5e74\u8fd9\u4e2a\u9879\u76ee\u7531apache software foundation\u8fc1\u79fb\u5230\u4e86Google code&#xff0c;\u5e76\u4e14\u6539\u540d\u4e3aMyBatis\u3002<\/p>\n<p>\u5b98\u7f51&#xff1a;https:\/\/mybatis.org\/mybatis-3\/zh\/index.html<\/p>\n<h4>\u6301\u4e45\u5c42<\/h4>\n<p>\u8d1f\u8d23\u5c06\u6570\u636e\u5230\u4fdd\u5b58\u5230\u6570\u636e\u5e93\u7684\u90a3\u4e00\u5c42\u4ee3\u7801<\/p>\n<p>JavaEE\u4e09\u5c42\u67b6\u6784:\u8868\u73b0\u5c42\u3001\u4e1a\u52a1\u5c42\u3001\u6301\u4e45\u5c42<\/p>\n<h4>\u6846\u67b6<\/h4>\n<p>\u6846\u67b6\u5c31\u662f\u4e00\u4e2a\u534a\u6210\u54c1\u8f6f\u4ef6&#xff0c;\u662f\u4e00\u5957\u53ef\u91cd\u7528\u7684&#xff0c;\u901a\u7528\u7684&#xff0c;\u8f6f\u4ef6\u57fa\u7840\u4ee3\u7801\u6a21\u578b<\/p>\n<p>\u5728\u6846\u67b6\u7684\u57fa\u7840\u4e4b\u4e0a\u6784\u5efa\u8f6f\u4ef6\u7f16\u5199\u66f4\u52a0\u9ad8\u6548&#xff0c;\u89c4\u8303&#xff0c;\u901a\u7528&#xff0c;\u53ef\u6269\u5c55<\/p>\n<h4>MyBatis\u7b80\u5316<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"998\" src=\"2025-05-13tbmuuv3pjq0.png\" width=\"2225\" \/><\/p>\n<h5>\u5feb\u901f\u5165\u95e8<\/h5>\n<p>\u8be6\u7ec6\u7f51\u5740&#xff1a;<\/p>\n<p>\u5165\u95e8_MyBatis\u4e2d\u6587\u7f51<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"736\" src=\"2025-05-13s3lf1d1yssq.png\" width=\"1807\" \/><\/p>\n<h4>Mapper\u4ee3\u7406\u5f00\u53d1<\/h4>\n<p>\u76ee\u7684&#xff1a;<\/p>\n<p>\u89e3\u51b3\u539f\u751f\u653e\u5f0f\u4e2d\u7684\u786c\u7f16\u7801\u95ee\u9898<\/p>\n<p>\u7b80\u5316\u540e\u671f\u6267\u884cSQL<\/p>\n<h5>\u4f7f\u7528<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"546\" src=\"2025-05-13gaj0uv2cgez.png\" width=\"1625\" \/><\/p>\n<p>\u7b2c\u4e00\u6b65\u5c06\u63a5\u53e3\u548csql\u6620\u5c04\u6587\u4ef6\u653e\u5728\u540c\u4e00\u4e2a\u5305\u540d\u4e0b\u9762&#xff1a;<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"528\" src=\"2025-05-13gj3di3bebsv.png\" width=\"834\" \/><\/p>\n<p>\u4fee\u6539\u540d\u79f0\u7a7a\u95f4\u540d&#xff0c;\u4f7f\u5176\u4e0eMapper\u63a5\u53e3\u7684\u6743\u9650\u5b9a\u540d\u76f8\u540c<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"758\" src=\"2025-05-132dyfgjaxz0j.png\" width=\"2234\" \/><\/p>\n<p>\u521b\u5efa\u63a5\u53e3\u4fdd\u8bc1\u91cc\u9762\u7684\u8fd4\u56de\u503c\u548c\u65b9\u6cd5\u540d\u548c\u53c2\u6570\u4e0esql\u6620\u5c04\u6587\u4ef6\u7684sq\u8fd4\u56de\u503c\u8bed\u53e5\u7684\u552f\u4e00\u6807\u8bc6\u53c2\u6570\u76f8\u540c\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"769\" src=\"2025-05-13k1zmnohpatt.png\" width=\"1383\" \/><\/p>\n<p>\u8fd8\u8981\u4fee\u6539mybatis-config.xml\u91cc\u9762\u7684mapper\u6620\u5c04\u8def\u5f84<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"774\" src=\"2025-05-13i4k3akkg4jz.png\" width=\"2239\" \/><\/p>\n<p>\u6700\u540e\u8fd0\u884c\u4ee3\u7801<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"409\" src=\"2025-05-13003kxe3nfde.png\" width=\"1248\" \/><\/p>\n<h5>sql\u7247\u6bb5&#xff0c;\u6bcf\u6b21\u4e66\u5199SQL\u8bed\u53e5\u7684\u65f6\u5019\u5c31\u53ef\u4ee5\u6389\u8c03\u7528\u8fd9\u4e2a\u7247\u6bb5\u7684di\u7b80\u5316<\/h5>\n<p>\u4e66\u5199<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"267\" src=\"2025-05-13txn3lrprnj4.png\" width=\"1610\" \/><\/p>\n<p>\u5f15\u7528<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"180\" src=\"2025-05-130zo3jntghax.png\" width=\"969\" \/><\/p>\n<h5>resultMap\u5b8c\u7f8e\u89e3\u7edd\u5b57\u6bb5\u540d\u548cMapper\u7c7b\u578b\u7684\u540d\u79f0\u4e0d\u4e00\u6837\u7684\u95ee\u9898<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"424\" src=\"2025-05-133rpwz0nryhm.png\" width=\"1146\" \/><\/p>\n<h5>\u53c2\u6570\u7684\u4f20\u5165<\/h5>\n<p>\u8981\u501f\u52a9\u53c2\u6570\u5360\u4f4d\u7b26\u6765\u4f20\u5165\u53c2\u6570&#xff1a;<\/p>\n<p>1\u00b7 #{} \u4f1a\u5c06\u5176\u53d8\u4e3a&#xff1f;&#xff0c;\u9632\u6b62sql\u6ce8\u5165<\/p>\n<p>2\u00b7 ${} \u4f1a\u4f7f\u7528\u62fc\u63a5\u5b57\u7b26\u4e32&#xff0c;\u5e76\u4e0d\u4f1a\u9632\u6b62sql\u6ce8\u5165<\/p>\n<p>\u5b9e\u4f8b&#xff1a;<\/p>\n<p>sql\u6620\u5c04\u4e2d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"100\" src=\"2025-05-135yrkoh5dgi1.png\" width=\"728\" \/><\/p>\n<p>\u00a0Mapper\u63a5\u53e3\u4e2d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"176\" src=\"2025-05-13n5tvns1n3d2.png\" width=\"545\" \/><\/p>\n<p>\u5982\u679c\u6709\u591a\u4e2a\u53c2\u6570\u5c31\u8981\u5728\u53c2\u6570\u524d\u9762\u6dfb\u52a0&#064;<\/p>\n<p>&#064;Param(&#034;&#034;)<\/p>\n<p>\u4f8b\u5982<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"586\" src=\"2025-05-13bwv4txgund3.png\" width=\"1557\" \/><\/p>\n<p>\u4e5f\u53ef\u4ee5\u901a\u8fc7\u4f20\u5165\u4e00\u4e2a\u5bf9\u5e94\u7684POJO\u7c7b&#xff0c;\u4f7f\u5176\u5c5e\u6027\u540d\u548c\u8981\u7528\u5230\u7684\u5b57\u6bb5\u540d\u4e00\u81f4\u5c31\u4f1a\u81ea\u52a8\u5339\u914d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"875\" src=\"2025-05-13jtj2524vu1m.png\" width=\"1898\" \/><\/p>\n<p>\u8fd8\u53ef\u4ee5\u901a\u8fc7Map\u96c6\u5408\u4f20\u5165<\/p>\n<p>*\u53ea\u9700\u8981\u4fdd\u8bc1sQL\u4e2d\u7684\u53c2\u6570\u540d\u548cmap\u96c6\u5408\u7684\u952e\u7684\u540d\u79f0\u5bf9\u5e94\u4e0a&#xff0c;\u5373\u53ef\u8bbe\u7f6e\u6210\u529f<\/p>\n<h5>\u52a8\u6001sql<\/h5>\n<h6>if\u8bed\u53e5<\/h6>\n<\/p>\n<p>\u4f7f\u7528if\u5224\u65ad\u54ea\u4e2a\u6761\u4ef6\u4e0d\u9700\u8981\u7684&#xff0c;\u8bfa\u4e0d\u6ee1\u8db3test\u91cc\u9762\u7684\u6761\u4ef6\u5c31\u4f1a\u5ffd\u7565if\u91cc\u9762\u7684\u8bed\u53e5<\/p>\n<p>&lt;select id&#061;&#034;selectUserByAll&#034; resultMap&#061;&#034;UserResultMap&#034;&gt;<br \/>\n        select * from user where<br \/>\n                               &lt;if test&#061;&#034;ID !&#061; null&#034;&gt;<br \/>\n                                   ID like #{ID}<br \/>\n                               &lt;\/if&gt;<br \/>\n                                &lt;if test&#061;&#034;Name !&#061; null and Name !&#061; &#039;&#039;&#034;&gt;<br \/>\n                                    and use_Name like #{Name}<br \/>\n                                &lt;\/if&gt;<br \/>\n                                &lt;if test&#061;&#034;Age !&#061; null&#034;&gt;<br \/>\n                                    and Age like #{Age}<br \/>\n                                &lt;\/if&gt;;<\/p>\n<p>    &lt;\/select&gt; <\/p>\n<p>\u4e0a\u8ff0\u8bed\u53e5\u8fd8\u6709\u95ee\u9898&#xff0c;\u5982\u679c\u53ea\u6709\u4e2d\u95f4\u6709&#xff0c;\u5219\u4f1a\u8ba9\u5176\u53d8\u4e3awhere and use_Name like #{Name}\u8fd9\u6837\u4f1a\u62a5\u9519\u3002\u89e3\u51b3\u65b9\u6cd5&#xff0c;\u4f7f\u7528where\u8bed\u53e5\u5305\u88f9&#xff0c;\u4f1a\u53bb\u6389\u524d\u9762\u591a\u4f59\u7684and<\/p>\n<p>&lt;select id&#061;&#034;selectUserByAll&#034; resultMap&#061;&#034;UserResultMap&#034;&gt;<br \/>\n        select * from user &lt;where&gt;<br \/>\n                               &lt;if test&#061;&#034;ID !&#061; null&#034;&gt;<br \/>\n                                   and ID like #{ID}<br \/>\n                               &lt;\/if&gt;<br \/>\n                                &lt;if test&#061;&#034;Name !&#061; null and Name !&#061; &#039;&#039;&#034;&gt;<br \/>\n                                    and use_Name like #{Name}<br \/>\n                                &lt;\/if&gt;<br \/>\n                                &lt;if test&#061;&#034;Age !&#061; null&#034;&gt;<br \/>\n                                    and Age like #{Age}<br \/>\n                                &lt;\/if&gt;;<br \/>\n                            &lt;\/where&gt;<br \/>\n    &lt;\/select&gt; <\/p>\n<h6>choose\u8bed\u53e5.<\/h6>\n<p>\u591a\u6761\u4ef6\u4e2d\u9009\u62e9\u4e00\u4e2a<\/p>\n<p>choose&#xff08;when,otherwise):\u9009\u62e9&#xff0c;\u7c7b\u4f3c\u4e8eJava\u4e2d\u7684switch\u8bed\u53e5<\/p>\n<p>&lt;select id&#061;&#034;selectUserByAll_choose&#034; resultMap&#061;&#034;UserResultMap&#034;&gt;<br \/>\n        select * from user where<br \/>\n        &lt;choose&gt;<br \/>\n            &lt;when test&#061;&#034;ID !&#061; null&#034;&gt;<br \/>\n            and ID like #{ID}<br \/>\n            &lt;\/when&gt;<br \/>\n            &lt;when test&#061;&#034;Name !&#061; null and Name !&#061; &#039;&#039;&#034;&gt;<br \/>\n                and use_Name like #{Name}<br \/>\n            &lt;\/when&gt;<br \/>\n            &lt;when test&#061;&#034;Age !&#061; null&#034;&gt;<br \/>\n                and Age like #{Age}<br \/>\n            &lt;\/when&gt;<br \/>\n            &lt;otherwise&gt;<br \/>\n                and 1 !&#061; 1<br \/>\n            &lt;\/otherwise&gt;<br \/>\n        &lt;\/choose&gt;<br \/>\n    &lt;\/select&gt; <\/p>\n<h4>insert\u8bed\u53e5<\/h4>\n<h5>\u57fa\u672c\u4f7f\u7528<\/h5>\n<p>\u8981\u7528insert\u8bed\u53e5\u6765\u8fdb\u884c\u5bf9\u5176\u6570\u636e\u7684\u6dfb\u52a0&#xff0c;<\/p>\n<p>&lt;insert id&#061;&#034;insertUser&#034;&gt;<br \/>\n        insert into user(ID,use_Name,Age)<br \/>\n        values (#{ID},#{useName},#{Age});<br \/>\n    &lt;\/insert&gt; <\/p>\n<p>\u8981\u6ce8\u610f\u7684\u662f&#xff0c;\u8fd9\u91ccmapper\u4ee3\u7406\u4e0d\u4f1a\u81ea\u52a8\u63d0\u4ea4\u4e8b\u52a1&#xff0c;\u8981\u8c03\u7528sqlSession.commit().\u624d\u4f1a\u63d0\u4ea4\u6dfb\u52a0\u540e\u7684\u7ed3\u679c<\/p>\n<p> String resource &#061; &#034;mybatis-config.xml&#034;;<br \/>\n        InputStream inputStream &#061; Resources.getResourceAsStream(resource);<br \/>\n        SqlSessionFactory sqlSessionFactory &#061; new SqlSessionFactoryBuilder().build(inputStream);<br \/>\n        SqlSession sqlSession &#061; sqlSessionFactory.openSession();<br \/>\n        userMapper mapper &#061; sqlSession.getMapper(userMapper.class);<br \/>\n        User user &#061; new User();<br \/>\n        user.setUse_Name(&#034;\u5927\u5f3a&#034;);<br \/>\n        user.setAge(88);<br \/>\n        user.setID(5);<br \/>\n        mapper.insertUser(user);<br \/>\n        sqlSession.commit(); <\/p>\n<p>\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u81ea\u52a8\u63d0\u4ea4\u4e8b\u52a1<\/p>\n<p>SqlSession sqlSession &#061; sqlSessionFactory.openSession(true); <\/p>\n<h5>\u4e3b\u952e\u8fd4\u56de<\/h5>\n<p>\u5bf9sql\u6620\u5c04\u6587\u4ef6\u8fdb\u884c\u8bbe\u7f6e&#xff0c;\u4f7f\u5176\u81ea\u52a8\u5c06\u4e3b\u952e\u7684\u503c\u8fd4\u56de\u5230\u5bf9\u8c61\u5bf9\u5e94\u7684\u5c5e\u6027\u53bb&#xff0c;\u8bbe\u7f6euseGeneratedKeys&#061;&#034;true&#034; keyProperty&#061;&#034;ID&#034;&#xff1b;\u5c31\u4f1a\u5c06\u4e3b\u952e\u7684\u503c\u8fd4\u56de\u5230user\u5bf9\u8c61\u7684\u5bf9\u5e94ID\u5c5e\u6027\u4e2d\u3002<\/p>\n<p>&lt;insert id&#061;&#034;insertUser&#034; useGeneratedKeys&#061;&#034;true&#034; keyProperty&#061;&#034;ID&#034;&gt;<br \/>\n        insert into user(ID,use_Name,Age)<br \/>\n        values (#{ID},#{useName},#{Age});<br \/>\n    &lt;\/insert&gt; <\/p>\n<h4>update\u8bed\u53e5<\/h4>\n<p>\u53ef\u4ee5\u76f4\u63a5\u4f20\u5165\u5bf9\u8c61\u5c01\u88c5\u7684\u5c5e\u6027&#xff0c;\u4e5f\u53ef\u624b\u52a8\u4e00\u4e2a\u5b57\u6bb5\u4e00\u4e2a\u5b57\u6bb5\u7684\u6dfb\u52a0<\/p>\n<p>&lt;update id&#061;&#034;updateByID&#034;&gt;<br \/>\n        update user set use_Name&#061;#{Name},Age&#061;#{Age} where ID &#061; #{ID};<br \/>\n    &lt;\/update&gt; <\/p>\n<h4 style=\"background-color:transparent\">delete\u8bed\u53e5<\/h4>\n<p>\u5355\u4e2a\u5220\u9664<\/p>\n<p>&lt;delete id&#061;&#034;deleteByID&#034;&gt;<br \/>\n        delete from user where id &#061; #{ID};<br \/>\n    &lt;\/delete&gt; <\/p>\n<p>\u00a0\u52a8\u6001\u5220\u9664&#xff1a;\u9700\u8981\u4f7f\u7528\u6570\u7ec4\u6765\u4f20\u5165\u53c2\u6570&#xff0c;foreach\u4f1a\u81ea\u52a8\u5c06\u4f20\u5165\u8fdb\u6765\u7684\u6570\u7ec4\u8f6c\u4e3aMap\u96c6\u5408&#xff0c;\u5e76\u8fdb\u884c\u62c6\u89e3&#xff0c;\u53ef\u4ee5\u6307\u5b9a\u5206\u9694\u7b26<\/p>\n<p>collection&#xff1a;\u952e\u540d\u79f0\u00a0 \u00a0 \u00a0item&#xff1a;\u5bf9\u5e94\u7684sql\u5b57\u6bb5\u00a0 \u00a0 separator&#xff1a;\u5206\u9694\u5b57\u7b26 open&#xff1a;\u4ee5\u4ec0\u4e48\u5f00\u59cb close&#xff1a;\u4ee5\u4ec0\u4e48\u7ed3\u675f<\/p>\n<p>&lt;delete id&#061;&#034;deleteByID&#034;&gt;<br \/>\n        delete from user where id in &lt;foreach collection &#061;&#034;array&#034; item &#061;&#034;ID&#034; separator&#061;&#034;,&#034; open&#061;&#034;(&#034; close&#061;&#034;)&#034;&gt;<br \/>\n        #{ID}<br \/>\n    &lt;\/foreach&gt;<br \/>\n    &lt;\/delete&gt; <\/p>\n<p>\u8fd9\u6bb5\u76f8\u5f53\u4e8e\u628aarray\u6570\u7ec4\u5728\u4e0b\u9762#{ID}\u6709\u591a\u5c11\u6b21&#xff1a;<\/p>\n<p>delete from user where id in(#{ID},#{ID} &#8230;&#8230;.)<\/p>\n<p>\u5e76\u7528,\u5206\u9694\u3002<\/p>\n<p>collection \u7ec6\u8282&#xff1a;\u5982\u679c\u662f\u6570\u7ec4\u5219&#061;\u201carray\u201d\u662f\u53ef\u4ee5\u7684&#xff0c;\u4e5f\u53ef\u4ee5\u81ea\u5df1\u7528&#064;Param\u6307\u5b9a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"181\" src=\"2025-05-13e53u0v51yhp.png\" width=\"1761\" \/><\/p>\n<h4>Mybaties\u5c01\u88c5\u53c2\u6570\u7684\u539f\u7406<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"794\" src=\"2025-05-132yeep3poshx.png\" width=\"927\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e25\u6b21\uff0c\u6536\u85cf9\u6b21\u3002Maven\u5bfc\u5165Maven\u9879\u76ee\u3002<\/p>\n","protected":false},"author":2,"featured_media":36930,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,190,100],"topic":[],"class_list":["post-36950","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-190","tag-100"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JDBC\uff1ajava\u4e0e\u6570\u636e\u5e93\u8fde\u63a5,Maven,MyBatis - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/36950.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JDBC\uff1ajava\u4e0e\u6570\u636e\u5e93\u8fde\u63a5,Maven,MyBatis - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e25\u6b21\uff0c\u6536\u85cf9\u6b21\u3002Maven\u5bfc\u5165Maven\u9879\u76ee\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/36950.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-12T17:03:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512170345-682229f1e2e63.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/36950.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/36950.html\",\"name\":\"JDBC\uff1ajava\u4e0e\u6570\u636e\u5e93\u8fde\u63a5,Maven,MyBatis - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-12T17:03:54+00:00\",\"dateModified\":\"2025-05-12T17:03:54+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/36950.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/36950.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/36950.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JDBC\uff1ajava\u4e0e\u6570\u636e\u5e93\u8fde\u63a5,Maven,MyBatis\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JDBC\uff1ajava\u4e0e\u6570\u636e\u5e93\u8fde\u63a5,Maven,MyBatis - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/36950.html","og_locale":"zh_CN","og_type":"article","og_title":"JDBC\uff1ajava\u4e0e\u6570\u636e\u5e93\u8fde\u63a5,Maven,MyBatis - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e25\u6b21\uff0c\u6536\u85cf9\u6b21\u3002Maven\u5bfc\u5165Maven\u9879\u76ee\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/36950.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-12T17:03:54+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512170345-682229f1e2e63.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/36950.html","url":"https:\/\/www.wsisp.com\/helps\/36950.html","name":"JDBC\uff1ajava\u4e0e\u6570\u636e\u5e93\u8fde\u63a5,Maven,MyBatis - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-12T17:03:54+00:00","dateModified":"2025-05-12T17:03:54+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/36950.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/36950.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/36950.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"JDBC\uff1ajava\u4e0e\u6570\u636e\u5e93\u8fde\u63a5,Maven,MyBatis"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/36950","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=36950"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/36950\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/36930"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=36950"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=36950"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=36950"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=36950"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}