{"id":939,"date":"2014-09-24T21:11:54","date_gmt":"2014-09-24T13:11:54","guid":{"rendered":"http:\/\/blog.amjet.biz\/IT\/?p=939"},"modified":"2014-10-23T10:05:23","modified_gmt":"2014-10-23T02:05:23","slug":"glassfish-mysql-no-database-selected","status":"publish","type":"post","link":"https:\/\/blog.amjet.biz\/IT\/?p=939","title":{"rendered":"Glassfish + MySQL = No database selected"},"content":{"rendered":"<p>\u6700\u8fd1\u5728 Glassfish application server \u4e0a\u8a2d\u5b9a MySQL datasource \u53ca connection pool \u5f8c\uff0c\u4ee5 JPA \u5b58\u53d6 database \u6642\u537b\u51fa\u73fe No database selected \u932f\u8aa4\u8a0a\u606f\uff0c\u5728\u9019\u500b <a href=\"http:\/\/www.wobblycogs.co.uk\/index.php\/computing\/jee\/102-mysql-jdbc-connection-pool-in-glassfish\" target=\"_blank\">\u7db2\u5740<\/a> \u627e\u5230\u4e86\u7b54\u6848\u3002<\/p>\n<p>\u5efa\u7acb connection pool (<a href=\"http:\/\/dev.mysql.com\/doc\/connector-j\/en\/connector-j-usagenotes-glassfish-config.html\" target=\"_blank\">\u6559\u5b78\u7db2\u5740<\/a>) \u6642\u6709\u5f88\u591a additional property\uff0c\u5176\u4e2d\u6709\u4e00\u500b Url \u8981\u586b\u4f8b\u5982 jdbc:mysql:\/\/localhost:3306\/mydb\uff0c\u586b\u597d\u9023\u8cc7\u6599\u5eab\u5c31\u51fa\u73fe\u6a19\u984c\u7684\u932f\u8aa4\uff0c\u8981\u628a property name &#8216;Url&#8217; \u6539\u6210 &#8216;URL&#8217; \u624d\u53ef\u4ee5\u6b63\u5e38\u9023\u7dda\u3002<\/p>\n<p>[ratings]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u5728 Glassfish application server \u4e0a\u8a2d\u5b9a MySQL datasource \u53ca connection pool \u5f8c\uff0c\u4ee5 JPA \u5b58\u53d6 database \u6642\u537b\u51fa\u73fe No database selected \u932f\u8aa4\u8a0a\u606f\uff0c\u5728\u9019\u500b \u7db2\u5740 \u627e\u5230\u4e86\u7b54\u6848\u3002 \u5efa\u7acb connection pool (\u6559\u5b78\u7db2\u5740) \u6642\u6709\u5f88\u591a additional property\uff0c\u5176\u4e2d\u6709\u4e00\u500b Url \u8981\u586b\u4f8b\u5982 jdbc:mysql:\/\/localhost:3306\/mydb\uff0c\u586b\u597d\u9023\u8cc7\u6599\u5eab\u5c31\u51fa\u73fe\u6a19\u984c\u7684\u932f\u8aa4\uff0c\u8981\u628a property name &#8216;Url&#8217; \u6539\u6210 &#8216;URL&#8217; \u624d\u53ef\u4ee5\u6b63\u5e38\u9023\u7dda\u3002 [ratings]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[109,26],"class_list":["post-939","post","type-post","status-publish","format-standard","hentry","category-java","tag-glassfish","tag-mysql"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/posts\/939","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=939"}],"version-history":[{"count":2,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/posts\/939\/revisions"}],"predecessor-version":[{"id":941,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/posts\/939\/revisions\/941"}],"wp:attachment":[{"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=939"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=939"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=939"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}