{"id":8578,"date":"2022-11-17T13:23:00","date_gmt":"2022-11-17T05:23:00","guid":{"rendered":"http:\/\/123.57.164.21\/?p=8578"},"modified":"2022-11-17T13:24:51","modified_gmt":"2022-11-17T05:24:51","slug":"%e5%85%b3%e4%ba%8emybatis%e4%b8%ad%e7%9a%84properties%e5%b1%9e%e6%80%a7%e4%b8%ad%e7%9a%84-url%e5%92%8cresource%e7%9a%84%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=8578","title":{"rendered":"\u5173\u4e8eMybatis\u4e2d\u7684properties\u5c5e\u6027\u4e2d\u7684 url \u548c resource \u7684\u4f7f\u7528"},"content":{"rendered":"\n<p>\u6211\u4eec\u4f7f\u7528Mybatis\u7684\u65f6\u5019<br>\u662f\u9700\u8981\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u914d\u7f6eproperty\u5c5e\u6027\u7684<\/p>\n\n\n\n<p><strong>\u6700\u76f4\u63a5\u7684\u5199\u6cd5<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u6700\u7b80\u5355\u7684\u5199\u6cd5\u5c31\u662f\u76f4\u63a5\u5c06\u5168\u90e8\u5185\u5bb9\u5199\u5728dataSource\u6807\u7b7e\u4e0b\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=\"\">&lt;dataSource type=\"POOLED\">\n    &lt;property name=\"driver\" value=\"com.mysql.cj.jdbc.Driver\"\/>\n    &lt;property name=\"url\" value=\"jdbc:mysql:\/\/localhost:3306\/mybatisstudy?serverTimezone=UTC\"\/>\n    &lt;property name=\"username\" value=\"\u4f60\u7684\u7528\u6237\u540d\"\/>\n    &lt;property name=\"password\" value=\"\u4f60\u7684\u5bc6\u7801\"\/>\n&lt;\/dataSource><\/pre>\n\n\n\n<p><br><strong>\u4f7f\u7528<a rel=\"noreferrer noopener\" href=\"https:\/\/so.csdn.net\/so\/search?q=properties&amp;spm=1001.2101.3001.7020\" target=\"_blank\">properties<\/a>\u6807\u7b7e<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u5f53\u7136\u6211\u4eec\u4e5f\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6eproperties\u5c5e\u6027 \u5728\u5176\u4e2d\u8bbe\u7f6e\u6211\u4eec\u7684property\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=\"\">&lt;properties>\n    &lt;property name=\"driver\" value=\"com.mysql.cj.jdbc.Driver\"\/>\n    &lt;property name=\"url\" value=\"jdbc:mysql:\/\/localhost:3306\/mybatisstudy?serverTimezone=UTC\"\/>\n    &lt;property name=\"username\" value=\"\u4f60\u7684\u7528\u6237\u540d\"\/>\n    &lt;property name=\"password\" value=\"\u4f60\u7684\u5bc6\u7801\"\/>\n&lt;\/properties><\/pre>\n\n\n\n<p>\u7136\u540e\u5728\u4e0b\u9762\u7684dataSource\u6807\u7b7e\u4e2d\u5f15\u7528\u6211\u4eec\u7684\u5199\u7684property<\/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=\"\">&lt;dataSource type=\"POOLED\">\n    &lt;property name=\"driver\" value=\"${driver}\"\/>\n    &lt;property name=\"url\" value=\"${url}\"\/>\n    &lt;property name=\"username\" value=\"${username}\"\/>\n    &lt;property name=\"password\" value=\"${password}\"\/>\n&lt;\/dataSource><\/pre>\n\n\n\n<p>dataSource\u4e0b\u7684property\u6807\u7b7e\u4e2d\u7684value\uff0c\u662f\u4e0a\u9762\u6211\u4eecproperties\u4e0bproperty\u4e2d\u7684key\u3002<\/p>\n\n\n\n<p><strong>\u5f15\u7528\u5916\u90e8\u7684properties<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<ul><li><strong>\u901a\u8fc7resource\u7684\u5f62\u5f0f<\/strong><\/li><\/ul>\n\n\n\n<p>\u6211\u4eec\u5728\u9879\u76ee\u7684resource\u4e0b\u65b0\u5efa\u4e00\u4e2ajdbcConfig.properties\u6587\u4ef6<\/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=\"\">jdbc.driver=com.mysql.cj.jdbc.Driver\njdbc.url=jdbc:mysql:\/\/localhost:3306\/mybatisstudy?serverTimezone=UTC\njdbc.username=\u4f60\u7684\u7528\u6237\u540d\njdbc.password=\u4f60\u7684\u5bc6\u7801\n<\/pre>\n\n\n\n<p>\u7136\u540e\u6211\u4eec\u5728properties\u6807\u7b7e\u5904\u8bbe\u7f6eresource\u5c5e\u6027<\/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=\"\">&lt;properties resource=\"jdbcConfig.properties\">&lt;\/properties><\/pre>\n\n\n\n<p>\u56e0\u4e3a\u6211\u4eec\u7684key\u6539\u4e86 \u56e0\u6b64\u5728dataSource\u6807\u7b7e\u4e0b\u7684property\u4e2d\u7684\u5f15\u7528\u4e5f\u9700\u8981\u6539\u53d8\u4e00\u4e0b<\/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=\"\">&lt;dataSource type=\"POOLED\">\n    &lt;property name=\"driver\" value=\"${jdbc.driver}\"\/>\n    &lt;property name=\"url\" value=\"${jdbc.url}\"\/>\n    &lt;property name=\"username\" value=\"${jdbc.username}\"\/>\n    &lt;property name=\"password\" value=\"${jdbc.password}\"\/>\n&lt;\/dataSource><\/pre>\n\n\n\n<ul><li><strong>\u901a\u8fc7url\u65b9\u5f0f<\/strong><\/li><\/ul>\n\n\n\n<p>\u53ea\u9700\u8981\u5c06resource\u5c5e\u6027\u53bb\u6389 \u6362\u6210url\u5c5e\u6027 \u5176\u4ed6\u90fd\u4e00\u6837<\/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=\"\">&lt;properties url=\"file:\/\/\/E:\/java_source\/MybatisWithCRUD01\/src\/main\/resources\/jdbcConfig.properties\">&lt;\/properties><\/pre>\n\n\n\n<p><strong>url\u4e0eresource\u7684\u5bf9\u6bd4<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<ul><li><strong>resource<\/strong><\/li><\/ul>\n\n\n\n<p>\u9996\u5148resource\u662f\u6bd4\u8f83\u5e38\u7528\u7684<\/p>\n\n\n\n<p>resource\u5c5e\u6027\u662f\u6309\u7167\u7c7b\u8def\u5f84\u7684\u5199\u6cd5\u6765\u5199\u7684,\u56e0\u6b64\u5fc5\u987b\u5b58\u5728\u4e8e\u7c7b\u8def\u5f84\u4e0b<\/p>\n\n\n\n<ul><li>url<\/li><\/ul>\n\n\n\n<p>URL\uff1a Uniform Resource Locator \u7edf\u4e00\u8d44\u6e90\u5b9a\u4f4d\u7b26<\/p>\n\n\n\n<p>\u6bd4\u5982\u8fd9\u4e2a\u5c31\u662f\u4e00\u4e2aURL<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> http:\/\/localhost:8080\/ABC\/DEF<\/pre>\n\n\n\n<p>\u534f\u8bae\u662f:http \u4e3b\u673a\u662f:localhost \u7aef\u53e3\u662f8080<br>\u5176\u4ed6\u7684\u90fd\u662f URI(\u5728\u8fd9\u91cc\u5c31\u662f\/ABC\/DEF)<\/p>\n\n\n\n<ul><li>URI<\/li><\/ul>\n\n\n\n<p>URI\uff1aUniform Resource Identifier \u7edf\u4e00\u8d44\u6e90\u6807\u8bc6\u7b26<br>\u5b83\u662f\u53ef\u4ee5\u5728 web \u5e94\u7528\u4e2d\u552f\u4e00\u5b9a\u4f4d\u4e00\u4e2a\u8d44\u6e90\u7684\u8def\u5f84<\/p>\n\n\n\n<ul><li><strong>\u8865\u5145<\/strong><\/li><\/ul>\n\n\n\n<p>\u5982\u679c\u662f\u672c\u5730\u7684\u6587\u4ef6\u60f3\u83b7\u53d6\u5b83\u7684url<\/p>\n\n\n\n<p>1.\u76f4\u63a5\u62d6\u5230\u6d4f\u89c8\u5668\u4e2d\u5373\u53ef(\u6bd4\u5982\u6211\u4f7f\u7528\u7684\u8c37\u6b4c\u6d4f\u89c8\u5668\u5c31\u652f\u6301)<br>2.\u6309\u7167\u683c\u5f0f\u81ea\u5df1\u6572\u2026<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u4eec\u4f7f\u7528Mybatis\u7684\u65f6\u5019\u662f\u9700\u8981\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u914d\u7f6eproperty\u5c5e\u6027\u7684 \u6700\u76f4\u63a5\u7684\u5199\u6cd5 \u6700\u7b80\u5355\u7684\u5199\u6cd5\u5c31\u662f\u76f4\u63a5\u5c06 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/8578"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8578"}],"version-history":[{"count":3,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/8578\/revisions"}],"predecessor-version":[{"id":8581,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/8578\/revisions\/8581"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8578"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8578"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}