{"id":40162,"date":"2022-12-01T19:36:06","date_gmt":"2023-03-22T14:51:15","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8spring-boot%e5%86%85%e7%bd%ae%e7%9a%84h2%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84%e6%96%b9%e6%b3%95%e3%80%82\/"},"modified":"2024-04-29T03:21:08","modified_gmt":"2024-04-28T19:21:08","slug":"%e4%bd%bf%e7%94%a8spring-boot%e5%86%85%e7%bd%ae%e7%9a%84h2%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84%e6%96%b9%e6%b3%95%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8spring-boot%e5%86%85%e7%bd%ae%e7%9a%84h2%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84%e6%96%b9%e6%b3%95%e3%80%82\/","title":{"rendered":"\u4f7f\u7528Spring Boot\u5185\u7f6e\u7684H2\u6570\u636e\u5e93\u7684\u65b9\u6cd5"},"content":{"rendered":"<h3>\u9996\u5148<\/h3>\n<p>\u7531\u4e8e\u5404\u79cd\u60c5\u51b5\u7684\u539f\u56e0\uff0c\u6211\u4eec\u51b3\u5b9a\u5236\u4f5c\u4e00\u4e2a\u57fa\u4e8eSpring Boot\u7684Web\u5e94\u7528\u7a0b\u5e8f\u3002\u5728\u6b64\u8fc7\u7a0b\u4e2d\uff0c\u7531\u4e8e\u51b3\u5b9a\u4f7f\u7528\u5185\u5d4c\u7684H2\u6570\u636e\u5e93\uff0c\u6211\u6574\u7406\u4e86\u9047\u5230\u7684\u95ee\u9898\u548c\u8fdb\u884c\u7684\u8c03\u67e5\u3002\u987a\u4fbf\u63d0\u4e00\u4e0b\uff0cSpring Boot\u7684\u7248\u672c\u662f1.5.17\u3002<\/p>\n<h3>\u5728pom.xml\u4e2d\u6dfb\u52a0\u4f9d\u8d56\u5173\u7cfb\u3002<\/h3>\n<p>\u5728pom.xml\u6587\u4ef6\u4e2d\uff0c\u6dfb\u52a0spring-boot-starter-jdbc\u548ch2\u4f5c\u4e3a\u4f9d\u8d56\u5173\u7cfb\u3002<br \/>\n\u5982\u679c\u5728Spring Initializr\u4e0a\u521b\u5efa\u9879\u76ee\uff0c\u8bf7\u6dfb\u52a0\u4ee5\u4e0b\u4e24\u4e2a\u9009\u9879\u4f7f\u5176\u76f8\u540c\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">H2<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">JDBC<\/ul>\n<pre class=\"post-pre\"><code><span class=\"nt\">&lt;dependency&gt;<\/span>\r\n    <span class=\"nt\">&lt;groupId&gt;<\/span>org.springframework.boot<span class=\"nt\">&lt;\/groupId&gt;<\/span>\r\n    <span class=\"nt\">&lt;artifactId&gt;<\/span>spring-boot-starter-jdbc<span class=\"nt\">&lt;\/artifactId&gt;<\/span>\r\n<span class=\"nt\">&lt;\/dependency&gt;<\/span>\r\n<span class=\"nt\">&lt;dependency&gt;<\/span>\r\n    <span class=\"nt\">&lt;groupId&gt;<\/span>com.h2database<span class=\"nt\">&lt;\/groupId&gt;<\/span>\r\n    <span class=\"nt\">&lt;artifactId&gt;<\/span>h2<span class=\"nt\">&lt;\/artifactId&gt;<\/span>\r\n    <span class=\"nt\">&lt;scope&gt;<\/span>runtime<span class=\"nt\">&lt;\/scope&gt;<\/span>\r\n<span class=\"nt\">&lt;\/dependency&gt;<\/span>\r\n<\/code><\/pre>\n<h3>\u5728application.properties(.yml)\u6587\u4ef6\u4e2d\u6dfb\u52a0\u914d\u7f6e<\/h3>\n<p>\u5728application.properties\u6216application.yml\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u914d\u7f6e\u3002<br \/>\n\u914d\u7f6e\u5185\u5bb9\u5305\u62ec\u4ee5\u4e0b\u4e09\u4e2a\u9879\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">datasource\u306e\u8a2d\u5b9a<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30b3\u30cd\u30af\u30b7\u30e7\u30f3\u30d7\u30fc\u30eb\u306e\u8a2d\u5b9a\uff08\u5fc5\u8981\u306a\u3089\uff09<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">h2\u306e\u4fbf\u5229\u30c4\u30fc\u30eb\u306e\u8a2d\u5b9a\uff08\u5fc5\u8981\u306a\u3089\uff09<\/ul>\n<pre class=\"post-pre\"><code><span class=\"c\"># datasource\r\n<\/span><span class=\"py\">spring.datasource.driver-class-name<\/span><span class=\"p\">=<\/span><span class=\"s\">org.h2.Driver<\/span>\r\n<span class=\"py\">spring.datasource.url<\/span><span class=\"p\">=<\/span><span class=\"s\">jdbc:h2:.\/h2db\/sampledb<\/span>\r\n<span class=\"py\">spring.datasource.username<\/span><span class=\"p\">=<\/span><span class=\"s\">username<\/span>\r\n<span class=\"py\">spring.datasource.password<\/span><span class=\"p\">=<\/span><span class=\"s\">password<\/span>\r\n\r\n<span class=\"c\"># connection pool use tomcat\r\n<\/span><span class=\"py\">spring.datasource.tomcat.maxActive<\/span><span class=\"p\">=<\/span><span class=\"s\">10<\/span>\r\n<span class=\"py\">spring.datasource.tomcat.maxIdle<\/span><span class=\"p\">=<\/span><span class=\"s\">10<\/span>\r\n<span class=\"py\">spring.datasource.tomcat.minIdle<\/span><span class=\"p\">=<\/span><span class=\"s\">10<\/span>\r\n<span class=\"py\">spring.datasource.tomcat.initialSize<\/span><span class=\"p\">=<\/span><span class=\"s\">10<\/span>\r\n<span class=\"py\">spring.datasource.tomcat.defaultAutoCommit<\/span><span class=\"p\">=<\/span><span class=\"s\">false<\/span>\r\n\r\n<span class=\"c\"># h2 for debug tool\r\n# spring.h2.console.enabled=true\r\n# spring.h2.console.path=\/h2-console\r\n# spring.h2.console.settings.web-allow-others=true\r\n<\/span><\/code><\/pre>\n<p>\u4ee5\u4e0b\u662f\u5404\u4e2a\u8bbe\u7f6e\u7684\u5185\u5bb9\uff0c\u8be6\u7ec6\u8bf4\u660e\u5728\u5b98\u65b9\u6307\u5357\u7684appication.properties\u4e2d\u5199\u660e\u3002\u63a5\u4e0b\u6765\u4f1a\u89e3\u91ca\u4e00\u4e9b\u8981\u70b9\u3002<\/p>\n<h4>\u8fde\u63a5\u6c60\u53ea\u662f\u4f5c\u4e3a\u4e00\u4e2a\u6c60\u5b50\u6765\u4f7f\u7528\u3002<\/h4>\n<p>\u6839\u636e\u4ee5\u4e0a\u4fe1\u606f\uff0c\u6211\u6309\u7167Tomcat\u7684datasource\u5b9a\u4e49\u7684\u65b9\u5f0f\uff0c\u6dfb\u52a0\u4e86driverClass\u3001url\u3001username\u548cpassword\u7684\u5b9a\u4e49\uff0c\u5e76\u5220\u9664\u4e86spring.datasource.url\u7b49\u5b9a\u4e49\u3002\u4f46\u662f\u8fd9\u6837\u505a\u4f3c\u4e4e\u4e0d\u884c\u3002\u6b63\u786e\u7684\u505a\u6cd5\u4f3c\u4e4e\u662f\u53ea\u9700\u5c06\u5176\u5b9a\u4e49\u4e3a\u8fde\u63a5\u6c60\u3002<\/p>\n<p>\u6211\u8ba4\u4e3a\u6709\u4e9b\u4eba\u53ef\u80fd\u4f1a\u8ba4\u4e3a\u5185\u5d4c\u6570\u636e\u5e93\uff0c\u4e5f\u5c31\u662f\u5728\u540c\u4e00JVM\u8fdb\u7a0b\u4e2d\u4e3a\u4ec0\u4e48\u9700\u8981\u8fde\u63a5\u6c60\u5462\uff1f\u4f5c\u8005\u4e5f\u6709\u540c\u6837\u7684\u60f3\u6cd5\u3002\u56e0\u4e3a\u5bf9\u4e8e\u4e00\u822c\u7684Web\u5e94\u7528\u6765\u8bf4\uff0c\u8fd9\u662f\u5fc5\u9700\u7684\u3002\u867d\u7136\u6211\u6ca1\u6709\u8fdb\u884c\u6027\u80fd\u6d4b\u8bd5\uff0c\u6240\u4ee5\u65e0\u6cd5\u786e\u5b9a\u5176\u6548\u679c\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"c\"># datasource\r\n# nothing see connection pool\r\n<\/span>\r\n<span class=\"c\"># connection pool use tomcat\r\n<\/span><span class=\"py\">spring.datasource.tomcat.driver-class-name<\/span><span class=\"p\">=<\/span><span class=\"s\">org.h2.Driver<\/span>\r\n<span class=\"py\">spring.datasource.tomcat.url<\/span><span class=\"p\">=<\/span><span class=\"s\">jdbc:h2:.\/h2db\/sampledb<\/span>\r\n<span class=\"py\">spring.datasource.tomcat.username<\/span><span class=\"p\">=<\/span><span class=\"s\">username<\/span>\r\n<span class=\"py\">spring.datasource.tomcat.password<\/span><span class=\"p\">=<\/span><span class=\"s\">password<\/span>\r\n<span class=\"py\">spring.datasource.tomcat.maxActive<\/span><span class=\"p\">=<\/span><span class=\"s\">10<\/span>\r\n<span class=\"py\">spring.datasource.tomcat.maxIdle<\/span><span class=\"p\">=<\/span><span class=\"s\">10<\/span>\r\n<span class=\"py\">spring.datasource.tomcat.minIdle<\/span><span class=\"p\">=<\/span><span class=\"s\">10<\/span>\r\n<span class=\"py\">spring.datasource.tomcat.initialSize<\/span><span class=\"p\">=<\/span><span class=\"s\">10<\/span>\r\n<span class=\"py\">spring.datasource.tomcat.defaultAutoCommit<\/span><span class=\"p\">=<\/span><span class=\"s\">false<\/span>\r\n<\/code><\/pre>\n<h4>\u5c06H2\u7684\u6709\u7528\u529f\u80fd\u7528\u4f5c\u8c03\u8bd5\u5de5\u5177\u3002<\/h4>\n<p>\u5373\u4f7f\u662f\u5d4c\u5165\u5f0f\u6570\u636e\u5e93\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528h2\u7684Web\u7ba1\u7406\u529f\u80fd\u3002\u5d4c\u5165\u5f0f\u6570\u636e\u5e93\u5728\u4e0e\u5e94\u7528\u7a0b\u5e8f\u76f8\u540c\u7684JVM\u8fdb\u7a0b\u4e2d\u8fd0\u884c\uff0c\u5e76\u4e14\u7531\u4e8e\u662f\u4e13\u7528\u6570\u636e\u5e93\uff0c\u65e0\u6cd5\u901a\u8fc7\u7f51\u7edc\u8fde\u63a5\u8fdb\u884c\u8c03\u8bd5\uff0c\u975e\u5e38\u9ebb\u70e6\u3002\u4f7f\u7528Web\u7ba1\u7406\u529f\u80fd\u53ef\u4ee5\u67e5\u770b\u548c\u4fee\u6539\u5f53\u524d\u6570\u636e\u5e93\u7684\u6570\u636e\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"c\"># h2 for debug tool\r\n<\/span><span class=\"py\">spring.h2.console.enabled<\/span><span class=\"p\">=<\/span><span class=\"s\">true<\/span>\r\n<span class=\"py\">spring.h2.console.path<\/span><span class=\"p\">=<\/span><span class=\"s\">\/h2-console<\/span>\r\n<span class=\"py\">spring.h2.console.settings.web-allow-others<\/span><span class=\"p\">=<\/span><span class=\"s\">true<\/span>\r\n<\/code><\/pre>\n<p>\u7531\u4e8e\u8c03\u8bd5\u529f\u80fd, \u6700\u597d\u4e0d\u8981\u5728application.properties\u6587\u4ef6\u4e2d\u8fdb\u884c\u8bbe\u5b9a, \u800c\u662f\u5728\u7cfb\u7edf\u5c5e\u6027\u4e2d\u542f\u7528\u3002<br \/>\n\u8fd9\u6837\u5373\u4f7f\u5fd8\u8bb0\u4fee\u6539\u914d\u7f6e\u6587\u4ef6, \u8c03\u8bd5\u529f\u80fd\u4e5f\u80fd\u4fdd\u6301\u7981\u7528\u72b6\u6001, \u4ee4\u4eba\u653e\u5fc3\u3002<\/p>\n<p>java -jar your-app.jar -Dspring.h2.console.enabled=true -Dspring.h2.console.path=\/h2-console -Dspring.h2.console.settings.web-allow-others=true<br \/>\n\u8fd0\u884c\u547d\u4ee4\uff1ajava -jar your-app.jar -Dspring.h2.console.enabled=true -Dspring.h2.console.path=\/h2-console -Dspring.h2.console.settings.web-allow-others=true<\/p>\n<p>\u987a\u4fbf\u63d0\u4e00\u4e0b\uff0cspring.h2.console.settings.web-allow-others\u662f\u6307\u662f\u5426\u5141\u8bb8\u4ece\u8fdc\u7a0b\uff08\u5176\u4ed6PC\uff09\u8bbf\u95ee\u3002\u9ed8\u8ba4\u4e3afalse\uff0c\u53ea\u80fd\u4ece\u672c\u5730\uff0c\u4e5f\u5c31\u662f\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\u7684PC\u4e0a\u8bbf\u95ee\u3002<\/p>\n<h3>4. \u51c6\u5907\u6570\u636e\u5e93\u548c\u8868<\/h3>\n<p>\u5c3d\u7ba1H2\u6570\u636e\u5e93\u662f\u5185\u5b58\u6570\u636e\u5e93\uff0c\u4f46\u5d4c\u5165\u5f0f\u6570\u636e\u5e93\u53ef\u4ee5\u5b9e\u73b0\u6570\u636e\u6301\u4e45\u5316\u3002\u56e0\u6b64\uff0c\u5982\u679c\u6bcf\u6b21\u542f\u52a8\u90fd\u91cd\u65b0\u521d\u59cb\u5316\uff0c\u4f1a\u9020\u6210\u56f0\u6270\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">h2db\u306f\u63a5\u7d9a\u6587\u5b57\u5217\u3067\u6307\u5b9a\u3057\u305fdb\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306f\u81ea\u52d5\u3067\u4f5c\u6210\u3059\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>\u5b58\u5728\u3059\u308b\u5834\u5408\u306f\u65b0\u898f\u4f5c\u6210\uff08\u521d\u671f\u5316\uff09\u3057\u306a\u3044<\/p>\n<p>CREATE TABLE IF NOT EXISTS\u3067\u521d\u671f\u5316SQL\u3092\u5b9a\u7fa9\u3059\u308b<\/p>\n<p>\u30c6\u30fc\u30d6\u30eb\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u306f\u518d\u4f5c\u6210\u3055\u308c\u306a\u3044<\/p>\n<p>jdbc:h2:.\/h2db\/sampledb\u306f\u5b9f\u884c\u6642\u306e\u30ab\u30ec\u30f3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304b\u3089\u76f8\u5bfe\u3067\u898b\u305f\u30d1\u30b9\uff08.\/h2db\/sampledb\uff09\u306bDB\u30d5\u30a1\u30a4\u30eb\u3092\u683c\u7d0d\u3059\u308b\u610f\u5473\u3067\u3042\u308b<\/p>\n<p>\u76f8\u5bfe\u30d1\u30b9\u6307\u5b9a\u306f.\/\u304c\u91cd\u8981<\/p>\n<h3>5. jdbcTemplate\u3001datasource\u3001\u4e8b\u52a1\u63a7\u5236\u5c06\u81ea\u52a8\u914d\u7f6e\u3002<\/h3>\n<p>\u5982\u679c\u4ec5\u4f7f\u7528\u539f\u751f\u7684springframework\uff0c\u8fdb\u884c\u6570\u636e\u5e93\u8bbf\u95ee\u65f6\u9700\u8981\u8fdb\u884c\u5404\u79cd\u8bbe\u7f6e\uff08\u5982Bean\u5b9a\u4e49\u548cAOP\u7b49\uff09\uff0c\u4f46\u662f\u5bf9\u4e8espring boot\u800c\u8a00\uff0c\u8fd9\u4e9b\u8bbe\u7f6e\u5c06\u81ea\u52a8\u8fdb\u884c\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">datasource\u306eBean\u304c\u81ea\u52d5\u3067\u8a2d\u5b9a\u3055\u308c\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>JdbcTemplate,NamedParameterJdbcTemplate\u306eBean\u304c\u81ea\u52d5\u3067\u8a2d\u5b9a\u3055\u308c\u308b<\/p>\n<p>\u3059\u3050\u306b@Autowired\u7b49\u3067\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u304c\u3067\u304d\u308b<\/p>\n<p>@Transactional\u306b\u3088\u308b\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u5236\u5fa1\u304c\u6709\u52b9<\/p>\n<h3>\u6700\u540e (zu\u00ec<\/h3>\n<p>\u8fd9\u6b21\u662f\u5173\u4e8eSpring Boot Web\u5e94\u7528\u7a0b\u5e8f\u4e2d\u4f7f\u7528\u5d4c\u5165\u5f0fH2\u6570\u636e\u5e93\u7684\u65b9\u6cd5\uff0c\u6211\u603b\u7ed3\u4e86\u4e00\u4e9b\u95ee\u9898\u548c\u7814\u7a76\u7ed3\u679c\u3002<br \/>\n\u5b9e\u9645\u64cd\u4f5c\u65f6\uff0c\u6211\u53d1\u73b0\u8bbe\u7f6e\u975e\u5e38\u7b80\u5355\uff0c\u8d85\u51fa\u4e86\u6211\u7684\u9884\u671f\uff0c\u8fd9\u8ba9\u6211\u611f\u5230\u60ca\u8bb6\u3002\u4ece\u8fd9\u4e2a\u610f\u4e49\u4e0a\u8bf4\uff0cSpring Boot\u771f\u662f\u65b9\u4fbf\u6613\u7528\u5462\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148 \u7531\u4e8e\u5404\u79cd\u60c5\u51b5\u7684\u539f\u56e0\uff0c\u6211\u4eec\u51b3\u5b9a\u5236\u4f5c\u4e00\u4e2a\u57fa\u4e8eSpring Boot\u7684Web\u5e94\u7528\u7a0b\u5e8f\u3002\u5728\u6b64\u8fc7\u7a0b\u4e2d\uff0c\u7531\u4e8e\u51b3\u5b9a\u4f7f\u7528 [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-40162","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4f7f\u7528Spring Boot\u5185\u7f6e\u7684H2\u6570\u636e\u5e93\u7684\u65b9\u6cd5 - Blog - Silicon Cloud<\/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.silicloud.com\/zh\/blog\/\u4f7f\u7528spring-boot\u5185\u7f6e\u7684h2\u6570\u636e\u5e93\u7684\u65b9\u6cd5\u3002\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4f7f\u7528Spring Boot\u5185\u7f6e\u7684H2\u6570\u636e\u5e93\u7684\u65b9\u6cd5\" \/>\n<meta property=\"og:description\" content=\"\u9996\u5148 \u7531\u4e8e\u5404\u79cd\u60c5\u51b5\u7684\u539f\u56e0\uff0c\u6211\u4eec\u51b3\u5b9a\u5236\u4f5c\u4e00\u4e2a\u57fa\u4e8eSpring Boot\u7684Web\u5e94\u7528\u7a0b\u5e8f\u3002\u5728\u6b64\u8fc7\u7a0b\u4e2d\uff0c\u7531\u4e8e\u51b3\u5b9a\u4f7f\u7528 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528spring-boot\u5185\u7f6e\u7684h2\u6570\u636e\u5e93\u7684\u65b9\u6cd5\u3002\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-22T14:51:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-28T19:21:08+00:00\" \/>\n<meta name=\"author\" content=\"\u65b0, \u97f5\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u65b0, \u97f5\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8spring-boot%e5%86%85%e7%bd%ae%e7%9a%84h2%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84%e6%96%b9%e6%b3%95%e3%80%82\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8spring-boot%e5%86%85%e7%bd%ae%e7%9a%84h2%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84%e6%96%b9%e6%b3%95%e3%80%82\/\",\"name\":\"\u4f7f\u7528Spring Boot\u5185\u7f6e\u7684H2\u6570\u636e\u5e93\u7684\u65b9\u6cd5 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-03-22T14:51:15+00:00\",\"dateModified\":\"2024-04-28T19:21:08+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8spring-boot%e5%86%85%e7%bd%ae%e7%9a%84h2%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84%e6%96%b9%e6%b3%95%e3%80%82\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8spring-boot%e5%86%85%e7%bd%ae%e7%9a%84h2%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84%e6%96%b9%e6%b3%95%e3%80%82\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8spring-boot%e5%86%85%e7%bd%ae%e7%9a%84h2%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84%e6%96%b9%e6%b3%95%e3%80%82\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4f7f\u7528Spring Boot\u5185\u7f6e\u7684H2\u6570\u636e\u5e93\u7684\u65b9\u6cd5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9\",\"name\":\"\u65b0, \u97f5\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g\",\"caption\":\"\u65b0, \u97f5\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunxin\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8spring-boot%e5%86%85%e7%bd%ae%e7%9a%84h2%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84%e6%96%b9%e6%b3%95%e3%80%82\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u4f7f\u7528Spring Boot\u5185\u7f6e\u7684H2\u6570\u636e\u5e93\u7684\u65b9\u6cd5 - Blog - Silicon Cloud","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.silicloud.com\/zh\/blog\/\u4f7f\u7528spring-boot\u5185\u7f6e\u7684h2\u6570\u636e\u5e93\u7684\u65b9\u6cd5\u3002\/","og_locale":"zh_CN","og_type":"article","og_title":"\u4f7f\u7528Spring Boot\u5185\u7f6e\u7684H2\u6570\u636e\u5e93\u7684\u65b9\u6cd5","og_description":"\u9996\u5148 \u7531\u4e8e\u5404\u79cd\u60c5\u51b5\u7684\u539f\u56e0\uff0c\u6211\u4eec\u51b3\u5b9a\u5236\u4f5c\u4e00\u4e2a\u57fa\u4e8eSpring Boot\u7684Web\u5e94\u7528\u7a0b\u5e8f\u3002\u5728\u6b64\u8fc7\u7a0b\u4e2d\uff0c\u7531\u4e8e\u51b3\u5b9a\u4f7f\u7528 [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528spring-boot\u5185\u7f6e\u7684h2\u6570\u636e\u5e93\u7684\u65b9\u6cd5\u3002\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-03-22T14:51:15+00:00","article_modified_time":"2024-04-28T19:21:08+00:00","author":"\u65b0, \u97f5","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u65b0, \u97f5","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8spring-boot%e5%86%85%e7%bd%ae%e7%9a%84h2%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84%e6%96%b9%e6%b3%95%e3%80%82\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8spring-boot%e5%86%85%e7%bd%ae%e7%9a%84h2%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84%e6%96%b9%e6%b3%95%e3%80%82\/","name":"\u4f7f\u7528Spring Boot\u5185\u7f6e\u7684H2\u6570\u636e\u5e93\u7684\u65b9\u6cd5 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-03-22T14:51:15+00:00","dateModified":"2024-04-28T19:21:08+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8spring-boot%e5%86%85%e7%bd%ae%e7%9a%84h2%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84%e6%96%b9%e6%b3%95%e3%80%82\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8spring-boot%e5%86%85%e7%bd%ae%e7%9a%84h2%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84%e6%96%b9%e6%b3%95%e3%80%82\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8spring-boot%e5%86%85%e7%bd%ae%e7%9a%84h2%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84%e6%96%b9%e6%b3%95%e3%80%82\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u4f7f\u7528Spring Boot\u5185\u7f6e\u7684H2\u6570\u636e\u5e93\u7684\u65b9\u6cd5"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9","name":"\u65b0, \u97f5","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g","caption":"\u65b0, \u97f5"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunxin\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8spring-boot%e5%86%85%e7%bd%ae%e7%9a%84h2%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84%e6%96%b9%e6%b3%95%e3%80%82\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/40162","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=40162"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/40162\/revisions"}],"predecessor-version":[{"id":78003,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/40162\/revisions\/78003"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=40162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=40162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=40162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}