{"id":2649,"date":"2018-04-14T14:53:32","date_gmt":"2018-04-14T06:53:32","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=2649"},"modified":"2018-04-14T14:53:32","modified_gmt":"2018-04-14T06:53:32","slug":"druid-update-%e8%af%ad%e5%8f%a5%e6%8a%a5%e8%af%ad%e6%b3%95%e9%94%99%e8%af%af42000%e5%bc%82%e5%b8%b8%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=2649","title":{"rendered":"Druid update \u8bed\u53e5\u62a5\u8bed\u6cd5\u9519\u8bef42000\u5f02\u5e38\u89e3\u51b3\u529e\u6cd5"},"content":{"rendered":"<p>\n\t\u963f\u91cc\u7684 Druid \u975e\u5e38\u7684\u6d41\u884c\uff0c\u4f46\u662f\u7f51\u4e0a\u9047\u5230\u7684\u95ee\u9898\u4e5f\u591a\u3002\u4e1a\u4f59\u8349\u4e2a\u4eba\u4e5f\u4ece\u9047\u5230\u8fc7\u4e00\u4e2a\u5947\u602a\u7684\u95ee\u9898\uff0c\u4eca\u5929\u6211\u516c\u5e03\u4e00\u4e0b\u8be5\u95ee\u9898\u7684\u89e3\u51b3\u529e\u6cd5\u3002\n<\/p>\n<p>\n\t\u8fd9\u4e2a\u95ee\u9898\u4e3b\u8981\u662f\u5728\u6267\u884c&nbsp;update \u8bed\u53e5\u65f6\u62a5\u8bed\u6cd5\u9519\u8bef42000\u3002\n<\/p>\n<p>\n\t\u4e3a\u4e86\u91cd\u73b0\u8fd9\u4e2a\u95ee\u9898\uff0c\u6211\u4eec\u5148\u521b\u5efa\u4e00\u4e2a\u8868\uff1a\n<\/p>\n<pre class=\"brush:java;\">\r\ncreate table if not exists test0(\r\n\tid int primary key auto_increment,\r\n\tname varchar(20)\r\n);\r\n\/\/ \u4e1a\u4f59\u8349\uff1awww.xttblog.com\r\n\/\/String sql = &quot;update test0 set name=&#039;newName&#039; where id=1&quot; ;\/\/\u8fd9\u4e2a\u53ef\u4ee5\u8dd1\r\nString sql = &quot;update test0 set name=? &quot; ;\/\/\u62a5\u9519\u8dd1\u4e0d\u4e86\r\nPreparedStatement ps = conn.prepareStatement( sql ) ;\r\nps.setString( 1, &quot;name1&quot; ) ;<\/pre>\n<p>\n\t\u9519\u8bef\u5982\u4e0b\uff1a\n<\/p>\n<p>\n\t\u9519\u8bef\u780142000\u3002\n<\/p>\n<p>\n\tcom.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;?&#039; at line 1\u3002\n<\/p>\n<p>\n\t\u6211\u7684mysql\u662f5.6\u7684druid\u662f1.1.9.<br \/>\n\t\u4f7f\u7528apache\u7684comomio\u662f\u53ef\u4ee5update test0 set name=?\u662f\u53ef\u4ee5\u4f7f\u7528\u7684\uff0c\u4f46\u662fdruid\u5c31\u4e0d\u884c\u3002\n<\/p>\n<p>\n\t\u8fd9\u4e2a\u95ee\u9898\u5176\u5b9e\u4e0d\u662f Druid \u7684\u95ee\u9898\u3002\u4ea7\u751f\u539f\u56e0\u662f\uff1a\u6211\u5728\u521b\u5efa\u7684\u65f6\u5019\u7ed9\u4e86sql\uff0c\u67e5\u8be2\u7684\u65f6\u5019\u53c8\u586b\u4e0a\u4e86sql\u3002\u7ed9\u4e86\u4e24\u6b21sql\uff0c\u6240\u4ee5\u62a5\u9519\u4e86\u3002\u6240\u4ee5\u5927\u5bb6\u5728\u51fa\u4e86\u95ee\u9898\u65f6\u4e00\u5b9a\u8981\u4ed4\u7ec6\u68c0\u67e5\u54c8\u3002<\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=2649\">Druid update \u8bed\u53e5\u62a5\u8bed\u6cd5\u9519\u8bef42000\u5f02\u5e38\u89e3\u51b3\u529e\u6cd5<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u963f\u91cc\u7684 Druid \u975e\u5e38\u7684\u6d41\u884c\uff0c\u4f46\u662f\u7f51\u4e0a\u9047\u5230\u7684\u95ee\u9898\u4e5f\u591a\u3002\u4e1a\u4f59\u8349\u4e2a\u4eba\u4e5f\u4ece\u9047\u5230\u8fc7\u4e00\u4e2a\u5947\u602a\u7684\u95ee\u9898\uff0c\u4eca\u5929\u6211\u516c\u5e03\u4e00\u4e0b\u8be5\u95ee [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[301,69,681,394,430],"class_list":["post-2649","post","type-post","status-publish","format-standard","hentry","category-java","tag-druid","tag-java","tag-681","tag-394","tag-430"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2649","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2649"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2649\/revisions"}],"predecessor-version":[{"id":2650,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2649\/revisions\/2650"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}