{"id":54937,"date":"2025-08-13T13:39:46","date_gmt":"2025-08-13T05:39:46","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/54937.html"},"modified":"2025-08-13T13:39:46","modified_gmt":"2025-08-13T05:39:46","slug":"jdbc%e4%b8%ad%e4%ba%8b%e5%8a%a1%e5%9b%9e%e6%bb%9a%e5%a4%b1%e8%b4%a5%e7%9a%84%e6%8a%a5%e9%94%99%e4%b8%8e%e8%a7%a3%e5%86%b3%e6%96%b9%e6%a1%88","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/54937.html","title":{"rendered":"JDBC\u4e2d\u4e8b\u52a1\u56de\u6eda\u5931\u8d25\u7684\u62a5\u9519\u4e0e\u89e3\u51b3\u65b9\u6848"},"content":{"rendered":"<h2>JDBC\u4e2d\u4e8b\u52a1\u56de\u6eda\u5931\u8d25\u7684\u62a5\u9519\u4e0e\u89e3\u51b3\u65b9\u6848<\/h2>\n<p>\u5728JDBC\u5f00\u53d1\u4e2d\uff0c\u4e8b\u52a1\u56de\u6eda\u662f\u4fdd\u8bc1\u6570\u636e\u4e00\u81f4\u6027\u7684\u6838\u5fc3\u673a\u5236\u3002\u7136\u800c\uff0c\u5f00\u53d1\u8005\u5e38\u9047\u5230\\&#8221;Transaction rollback failed\\&#8221;\u6216\\&#8221;Could not roll back JDBC transaction\\&#8221;\u7b49\u5f02\u5e38\uff0c\u5bfc\u81f4\u6570\u636e\u6c61\u67d3\u751a\u81f3\u7cfb\u7edf\u5d29\u6e83\u3002\u672c\u6587\u57fa\u4e8eCSDN\u793e\u533a\u771f\u5b9e\u6848\u4f8b\uff0c\u7cfb\u7edf\u68b3\u7406JDBC\u4e8b\u52a1\u56de\u6eda\u5931\u8d25\u768412\u7c7b\u5178\u578b\u573a\u666f\uff0c\u63d0\u4f9b\u53ef\u843d\u5730\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<h3>\u4e00\u3001\u9ad8\u9891\u9519\u8bef\u573a\u666f\u4e0e\u8bca\u65ad\u77e9\u9635<\/h3>\n<h4>1.1 \u9519\u8bef\u7c7b\u578b\u5206\u7c7b<\/h4>\n<table>\n<tr>\n   \u9519\u8bef\u7c7b\u578b<br \/>\n   \u5178\u578b\u73b0\u8c61<br \/>\n   \u5173\u8054\u7ec4\u4ef6<br \/>\n   \u89e3\u51b3\u65b9\u6848\u4f18\u5148\u7ea7<br \/>\n  <\/tr>\n<tbody>\n<tr>\n<td>\u5b58\u50a8\u5f15\u64ce\u4e0d\u517c\u5bb9<\/td>\n<td>\u6267\u884c\u56de\u6eda\u540e\u6570\u636e\u4ecd\u88ab\u4fee\u6539\uff0c\u65e5\u5fd7\u663e\u793a\\&#8221;MyISAM storage engine doesn\u2019t support transaction\\&#8221;<\/td>\n<td>MySQL\u8868\u5f15\u64ce<\/td>\n<td>\u2605\u2605\u2605\u2605\u2605<\/td>\n<\/tr>\n<tr>\n<td>\u8fde\u63a5\u6c60\u914d\u7f6e\u4e0d\u5f53<\/td>\n<td>\u9ad8\u5e76\u53d1\u4e0b\u51fa\u73b0\\&#8221;Connection pool exhausted\\&#8221;\u9519\u8bef\uff0c\u4e8b\u52a1\u63d0\u4ea4\u8d85\u65f6<\/td>\n<td>Druid\/HikariCP<\/td>\n<td>\u2605\u2605\u2605\u2605\u2606<\/td>\n<\/tr>\n<tr>\n<td>\u624b\u52a8\u63d0\u4ea4\u540e\u5f02\u5e38<\/td>\n<td>\u4ee3\u7801\u4e2d\u5148\u8c03\u7528conn.commit()\u518d\u629b\u51fa\u5f02\u5e38\uff0c\u56de\u6eda\u5931\u6548<\/td>\n<td>\u4e1a\u52a1\u4ee3\u7801\u903b\u8f91<\/td>\n<td>\u2605\u2605\u2605\u2605\u2606<\/td>\n<\/tr>\n<tr>\n<td>\u6b7b\u9501\u5bfc\u81f4\u56de\u6eda\u5931\u8d25<\/td>\n<td>\u65e5\u5fd7\u663e\u793a\\&#8221;Deadlock found when trying to get lock\\&#8221;\uff0c\u4e8b\u52a1\u65e0\u6cd5\u63a8\u8fdb<\/td>\n<td>\u6570\u636e\u5e93\u9501\u673a\u5236<\/td>\n<td>\u2605\u2605\u2605\u2606\u2606<\/td>\n<\/tr>\n<tr>\n<td>DDL\u8bed\u53e5\u9690\u5f0f\u63d0\u4ea4<\/td>\n<td>\u4e8b\u52a1\u4e2d\u6267\u884cCREATE TABLE\u540e\uff0c\u540e\u7eed\u64cd\u4f5c\u65e0\u6cd5\u56de\u6eda<\/td>\n<td>SQL\u8bed\u53e5\u7c7b\u578b<\/td>\n<td>\u2605\u2605\u2605\u2606\u2606<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>1.2 \u8bca\u65ad\u4e09\u6b65\u6cd5<\/h4>\n<li>\u65e5\u5fd7\u5206\u6790\uff1a\u5f00\u542fJDBC\u65e5\u5fd7\uff08log4j.logger.java.sql=DEBUG\uff09\uff0c\u89c2\u5bdf\u5b9e\u9645\u6267\u884c\u7684SQL\u548c\u4e8b\u52a1\u72b6\u6001<\/li>\n<li>\u8fde\u63a5\u9a8c\u8bc1\uff1a\u901a\u8fc7connection.isValid(2)\u68c0\u67e5\u8fde\u63a5\u6d3b\u6027<\/li>\n<li>\u5f15\u64ce\u68c0\u67e5\uff1a\u6267\u884cSHOW TABLE STATUS LIKE \\&#8217;\u8868\u540d\\&#8217;\u786e\u8ba4\u5b58\u50a8\u5f15\u64ce\u7c7b\u578b<\/li>\n<h3>\u4e8c\u3001\u6838\u5fc3\u89e3\u51b3\u65b9\u6848\u4e0e\u4ee3\u7801\u793a\u4f8b<\/h3>\n<h4>2.1 \u5b58\u50a8\u5f15\u64ce\u95ee\u9898\u4fee\u590d<\/h4>\n<p>\u95ee\u9898\u73b0\u8c61\uff1a\u4f7f\u7528MyISAM\u5f15\u64ce\u7684\u8868\u6267\u884c\u4e8b\u52a1\u64cd\u4f5c\uff0c\u56de\u6eda\u540e\u6570\u636e\u4ecd\u88ab\u4fee\u6539<\/p>\n<p><span class=\"token comment\">\/\/ \u9519\u8bef\u793a\u4f8b\uff1aMyISAM\u8868\u4e0d\u652f\u6301\u4e8b\u52a1<\/span><br \/>\n<span class=\"token keyword\">public<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token function\">transferMoney<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">throws<\/span> <span class=\"token class-name\">SQLException<\/span> <span class=\"token punctuation\">{<\/p>\n<p>   <\/span><br \/>\n    <span class=\"token class-name\">Connection<\/span> conn <span class=\"token operator\">=<\/span> <span class=\"token class-name\">DriverManager<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">getConnection<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">\\&#8221;jdbc:mysql:\/\/localhost:3306\/test\\&#8221;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    conn<span class=\"token punctuation\">.<\/span><span class=\"token function\">setAutoCommit<\/span><span class=\"token punctuation\">(<\/span><span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">try<\/span> <span class=\"token punctuation\">{<\/p>\n<p>   <\/span><br \/>\n        <span class=\"token class-name\">Statement<\/span> stmt <span class=\"token operator\">=<\/span> conn<span class=\"token punctuation\">.<\/span><span class=\"token function\">createStatement<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        stmt<span class=\"token punctuation\">.<\/span><span class=\"token function\">executeUpdate<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">\\&#8221;UPDATE myisam_account SET balance = balance &#8211; 100 WHERE id = 1\\&#8221;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        stmt<span class=\"token punctuation\">.<\/span><span class=\"token function\">executeUpdate<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">\\&#8221;UPDATE myisam_account SET balance = balance + 100 WHERE id = 2\\&#8221;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        conn<span class=\"token punctuation\">.<\/span><span class=\"token function\">commit<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u5373\u4f7f\u6b64\u5904\u629b\u51fa\u5f02\u5e38\uff0c\u6570\u636e\u4ecd\u4f1a\u4fee\u6539<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">catch<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">SQLException<\/span> e<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/p>\n<p>   <\/span><br \/>\n        conn<span class=\"token punctuation\">.<\/span><span class=\"token function\">rollback<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u56de\u6eda\u65e0\u6548<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">finally<\/span> <span class=\"token punctuation\">{<\/p>\n<p>   <\/span><br \/>\n        conn<span class=\"token punctuation\">.<\/span><span class=\"token function\">close<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u4fee\u590d\u65b9\u6848\uff1a<\/p>\n<li>\u4fee\u6539\u8868\u5f15\u64ce\u4e3aInnoDB\uff08\u9700\u91cd\u542fMySQL\u670d\u52a1\uff09<\/li>\n<li>\u4e34\u65f6\u89e3\u51b3\u65b9\u6848\uff1a\u901a\u8fc7ALTER TABLE myisam_account ENGINE=InnoDB\u5728\u7ebf\u4fee\u6539<\/li>\n<p><span class=\"token comment\">&#8212; \u786e\u8ba4\u5f53\u524d\u5f15\u64ce<\/span><br \/>\n<span class=\"token keyword\">SHOW<\/span> <span class=\"token keyword\">CREATE<\/span> <span class=\"token keyword\">TABLE<\/span> myisam_account<span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">&#8212; \u4fee\u6539\u5f15\u64ce\uff08\u751f\u4ea7\u73af\u5883\u5efa\u8bae\u5728\u4f4e\u5cf0\u671f\u6267\u884c\uff09<\/span><br \/>\n<span class=\"token keyword\">ALTER<\/span> <span class=\"token keyword\">TABLE<\/span> myisam_account <span class=\"token keyword\">ENGINE<\/span><span class=\"token operator\">=<\/span><span class=\"token keyword\">InnoDB<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h4>2.2 \u8fde\u63a5\u6c60\u914d\u7f6e\u4f18\u5316<\/h4>\n<p>\u95ee\u9898\u73b0\u8c61\uff1a\u9ad8\u5e76\u53d1\u4e0b\u51fa\u73b0\\&#8221;Timeout waiting for idle object\\&#8221;\u9519\u8bef<\/p>\n<p>Druid\u914d\u7f6e\u4fee\u590d\u793a\u4f8b\uff1a<\/p>\n<p># application.properties<br \/>\nspring.datasource.druid.initial-size=5<br \/>\nspring.datasource.druid.max-active=50<br \/>\nspring.datasource.druid.max-wait=60000<br \/>\nspring.datasource.druid.time-between-eviction-runs-millis=60000<br \/>\nspring.datasource.druid.validation-query=SELECT 1<br \/>\nspring.datasource.druid.test-while-idle=true<\/p>\n<p>\u8fde\u63a5\u6709\u6548\u6027\u68c0\u67e5\u4ee3\u7801\uff1a<\/p>\n<p><span class=\"token keyword\">public<\/span> <span class=\"token class-name\">Connection<\/span> <span class=\"token function\">getValidConnection<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">throws<\/span> <span class=\"token class-name\">SQLException<\/span> <span class=\"token punctuation\">{<\/p>\n<p>   <\/span><br \/>\n    <span class=\"token class-name\">Connection<\/span> conn <span class=\"token operator\">=<\/span> dataSource<span class=\"token punctuation\">.<\/span><span class=\"token function\">getConnection<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>conn<span class=\"token punctuation\">.<\/span><span class=\"token function\">isValid<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">2<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/p>\n<p>   <\/span>  <span class=\"token comment\">\/\/ 2\u79d2\u8d85\u65f6\u68c0\u67e5<\/span><br \/>\n        conn<span class=\"token punctuation\">.<\/span><span class=\"token function\">close<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token keyword\">throw<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">SQLException<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">\\&#8221;Invalid connection detected\\&#8221;<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb397\u6b21\uff0c\u70b9\u8d5e9\u6b21\uff0c\u6536\u85cf12\u6b21\u3002JDBC\u4e8b\u52a1\u56de\u6eda\u5931\u8d25\u95ee\u9898\u5206\u6790\u4e0e\u89e3\u51b3\u65b9\u6848 \u6458\u8981\uff1aJDBC\u4e8b\u52a1\u56de\u6eda\u5931\u8d25\u662f\u6570\u636e\u5e93\u5f00\u53d1\u4e2d\u7684\u5e38\u89c1\u95ee\u9898\uff0c\u4e3b\u8981\u8868\u73b0\u5305\u62ec&quot;Transaction rollback failed&quot;\u7b49\u5f02\u5e38\u3002\u672c\u6587\u9488\u5bf912\u79cd\u5178\u578b\u573a\u666f\uff0c\u63d0\u51fa\u7cfb\u7edf\u5316\u89e3\u51b3\u65b9\u6848\u3002\u6838\u5fc3\u95ee\u9898\u5305\u62ec\uff1a1)MyISAM\u5f15\u64ce\u4e0d\u652f\u6301\u4e8b\u52a1\uff0c2)\u8fde\u63a5\u6c60\u914d\u7f6e\u4e0d\u5f53\uff0c3)\u4e8b\u52a1\u8fb9\u754c\u63a7\u5236\u5931\u8bef\u3002\u89e3\u51b3\u65b9\u6848\u6db5\u76d6\u5b58\u50a8\u5f15\u64ce\u8f6c\u6362\u3001\u8fde\u63a5\u6c60\u53c2\u6570\u4f18\u5316\u548c\u4e8b\u52a1\u6a21\u5f0f\u91cd\u6784\u3002\u5b9e\u6218\u5de5\u5177\u5305\u62ec\u4e8b\u52a1\u72b6\u6001\u76d1\u63a7\u3001\u6b7b\u9501\u68c0\u6d4b\u548c\u65e5\u5fd7\u5206\u6790\u6280\u672f\uff0c\u901a\u8fc7\u4ee3\u7801\u793a\u4f8b\u6f14\u793a\u4e86\u6b63\u786e\u7684\u4e8b\u52a1\u5904\u7406\u6a21\u5f0f\u3002\u672c\u6587\u4e3a\u5f00\u53d1\u4eba\u5458\u63d0\u4f9b\u4e86\u4e00\u5957\u5b8c\u6574\u7684JDBC\u4e8b\u52a1\u95ee\u9898<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[5617,5618,988,5619],"topic":[],"class_list":["post-54937","post","type-post","status-publish","format-standard","hentry","category-server","tag-jdbc","tag-5618","tag-988","tag-5619"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JDBC\u4e2d\u4e8b\u52a1\u56de\u6eda\u5931\u8d25\u7684\u62a5\u9519\u4e0e\u89e3\u51b3\u65b9\u6848 - \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\/54937.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JDBC\u4e2d\u4e8b\u52a1\u56de\u6eda\u5931\u8d25\u7684\u62a5\u9519\u4e0e\u89e3\u51b3\u65b9\u6848 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb397\u6b21\uff0c\u70b9\u8d5e9\u6b21\uff0c\u6536\u85cf12\u6b21\u3002JDBC\u4e8b\u52a1\u56de\u6eda\u5931\u8d25\u95ee\u9898\u5206\u6790\u4e0e\u89e3\u51b3\u65b9\u6848 \u6458\u8981\uff1aJDBC\u4e8b\u52a1\u56de\u6eda\u5931\u8d25\u662f\u6570\u636e\u5e93\u5f00\u53d1\u4e2d\u7684\u5e38\u89c1\u95ee\u9898\uff0c\u4e3b\u8981\u8868\u73b0\u5305\u62ec&quot;Transaction rollback failed&quot;\u7b49\u5f02\u5e38\u3002\u672c\u6587\u9488\u5bf912\u79cd\u5178\u578b\u573a\u666f\uff0c\u63d0\u51fa\u7cfb\u7edf\u5316\u89e3\u51b3\u65b9\u6848\u3002\u6838\u5fc3\u95ee\u9898\u5305\u62ec\uff1a1)MyISAM\u5f15\u64ce\u4e0d\u652f\u6301\u4e8b\u52a1\uff0c2)\u8fde\u63a5\u6c60\u914d\u7f6e\u4e0d\u5f53\uff0c3)\u4e8b\u52a1\u8fb9\u754c\u63a7\u5236\u5931\u8bef\u3002\u89e3\u51b3\u65b9\u6848\u6db5\u76d6\u5b58\u50a8\u5f15\u64ce\u8f6c\u6362\u3001\u8fde\u63a5\u6c60\u53c2\u6570\u4f18\u5316\u548c\u4e8b\u52a1\u6a21\u5f0f\u91cd\u6784\u3002\u5b9e\u6218\u5de5\u5177\u5305\u62ec\u4e8b\u52a1\u72b6\u6001\u76d1\u63a7\u3001\u6b7b\u9501\u68c0\u6d4b\u548c\u65e5\u5fd7\u5206\u6790\u6280\u672f\uff0c\u901a\u8fc7\u4ee3\u7801\u793a\u4f8b\u6f14\u793a\u4e86\u6b63\u786e\u7684\u4e8b\u52a1\u5904\u7406\u6a21\u5f0f\u3002\u672c\u6587\u4e3a\u5f00\u53d1\u4eba\u5458\u63d0\u4f9b\u4e86\u4e00\u5957\u5b8c\u6574\u7684JDBC\u4e8b\u52a1\u95ee\u9898\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/54937.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-13T05:39:46+00:00\" \/>\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=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/54937.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/54937.html\",\"name\":\"JDBC\u4e2d\u4e8b\u52a1\u56de\u6eda\u5931\u8d25\u7684\u62a5\u9519\u4e0e\u89e3\u51b3\u65b9\u6848 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-13T05:39:46+00:00\",\"dateModified\":\"2025-08-13T05:39:46+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/54937.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/54937.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/54937.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JDBC\u4e2d\u4e8b\u52a1\u56de\u6eda\u5931\u8d25\u7684\u62a5\u9519\u4e0e\u89e3\u51b3\u65b9\u6848\"}]},{\"@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\u4e2d\u4e8b\u52a1\u56de\u6eda\u5931\u8d25\u7684\u62a5\u9519\u4e0e\u89e3\u51b3\u65b9\u6848 - \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\/54937.html","og_locale":"zh_CN","og_type":"article","og_title":"JDBC\u4e2d\u4e8b\u52a1\u56de\u6eda\u5931\u8d25\u7684\u62a5\u9519\u4e0e\u89e3\u51b3\u65b9\u6848 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb397\u6b21\uff0c\u70b9\u8d5e9\u6b21\uff0c\u6536\u85cf12\u6b21\u3002JDBC\u4e8b\u52a1\u56de\u6eda\u5931\u8d25\u95ee\u9898\u5206\u6790\u4e0e\u89e3\u51b3\u65b9\u6848 \u6458\u8981\uff1aJDBC\u4e8b\u52a1\u56de\u6eda\u5931\u8d25\u662f\u6570\u636e\u5e93\u5f00\u53d1\u4e2d\u7684\u5e38\u89c1\u95ee\u9898\uff0c\u4e3b\u8981\u8868\u73b0\u5305\u62ec&quot;Transaction rollback failed&quot;\u7b49\u5f02\u5e38\u3002\u672c\u6587\u9488\u5bf912\u79cd\u5178\u578b\u573a\u666f\uff0c\u63d0\u51fa\u7cfb\u7edf\u5316\u89e3\u51b3\u65b9\u6848\u3002\u6838\u5fc3\u95ee\u9898\u5305\u62ec\uff1a1)MyISAM\u5f15\u64ce\u4e0d\u652f\u6301\u4e8b\u52a1\uff0c2)\u8fde\u63a5\u6c60\u914d\u7f6e\u4e0d\u5f53\uff0c3)\u4e8b\u52a1\u8fb9\u754c\u63a7\u5236\u5931\u8bef\u3002\u89e3\u51b3\u65b9\u6848\u6db5\u76d6\u5b58\u50a8\u5f15\u64ce\u8f6c\u6362\u3001\u8fde\u63a5\u6c60\u53c2\u6570\u4f18\u5316\u548c\u4e8b\u52a1\u6a21\u5f0f\u91cd\u6784\u3002\u5b9e\u6218\u5de5\u5177\u5305\u62ec\u4e8b\u52a1\u72b6\u6001\u76d1\u63a7\u3001\u6b7b\u9501\u68c0\u6d4b\u548c\u65e5\u5fd7\u5206\u6790\u6280\u672f\uff0c\u901a\u8fc7\u4ee3\u7801\u793a\u4f8b\u6f14\u793a\u4e86\u6b63\u786e\u7684\u4e8b\u52a1\u5904\u7406\u6a21\u5f0f\u3002\u672c\u6587\u4e3a\u5f00\u53d1\u4eba\u5458\u63d0\u4f9b\u4e86\u4e00\u5957\u5b8c\u6574\u7684JDBC\u4e8b\u52a1\u95ee\u9898","og_url":"https:\/\/www.wsisp.com\/helps\/54937.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-13T05:39:46+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/54937.html","url":"https:\/\/www.wsisp.com\/helps\/54937.html","name":"JDBC\u4e2d\u4e8b\u52a1\u56de\u6eda\u5931\u8d25\u7684\u62a5\u9519\u4e0e\u89e3\u51b3\u65b9\u6848 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-13T05:39:46+00:00","dateModified":"2025-08-13T05:39:46+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/54937.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/54937.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/54937.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"JDBC\u4e2d\u4e8b\u52a1\u56de\u6eda\u5931\u8d25\u7684\u62a5\u9519\u4e0e\u89e3\u51b3\u65b9\u6848"}]},{"@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\/54937","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=54937"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/54937\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=54937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=54937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=54937"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=54937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}