{"id":295,"date":"2011-05-27T01:04:34","date_gmt":"2011-05-26T16:04:34","guid":{"rendered":"http:\/\/www.typea.info\/blog\/index.php\/2011\/05\/27\/spring_tool_suite_springmvc_server_jndi_jdbc\/"},"modified":"2011-05-27T01:04:34","modified_gmt":"2011-05-26T16:04:34","slug":"spring_tool_suite_springmvc_server_jndi_jdbc","status":"publish","type":"post","link":"https:\/\/www.typea.info\/blog\/index.php\/2011\/05\/27\/spring_tool_suite_springmvc_server_jndi_jdbc\/","title":{"rendered":"Spring Tool Suite \u3067 Spring\u3000MVC \u304b\u3089 tc Server \u306e JNDI \u7d4c\u7531\u3067JDBC\u3092\u5229\u7528\u3059\u308b"},"content":{"rendered":"<p><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2011\/05\/19\/springsource_tool_suite_spring_mvc_spring_jdbc\">Spring MVC \u304b\u3089\u3001JDBC\u3092\u8a66\u3057\u305f<\/a> \u304c\u3001\u6b21\u306f\u3001JDBC \u3092 JNDI \u304b\u3089\u53d6\u5f97\u3057\u3066\u307f\u308b\u3002<\/p>\n<h2>tc Server \u306e\u8a2d\u5b9a\u3092\u89e6\u308b\u306e\u3067\u3001\u65b0\u898f\u306b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3059\u308b\u3002<\/h2>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/SpringToolSuiteServerJNDIJDBC_33D\/sts_jndi01.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px\" title=\"sts_jndi01\" border=\"0\" alt=\"sts_jndi01\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/SpringToolSuiteServerJNDIJDBC_33D\/sts_jndi01_thumb.jpg\" width=\"372\" height=\"150\" \/><\/a> <\/p>\n<p>Servers \u30d3\u30e5\u30fc\u304b\u3089\u3001\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u30e1\u30cb\u30e5\u30fc New \u2013 Server \u3042\u3068\u306f\u3001\u30a6\u30a3\u30b6\u30fc\u30c9\u306b\u5f93\u3044\u3001\u9069\u5f53\u306b\u540d\u524d\u306a\u3069\u3092\u8a2d\u5b9a\u3002<\/p>\n<h2>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3059\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001C:\\springsource\\vfabric-tc-server-developer-2.5.0.RELEASE\\ \u30d5\u30a9\u30eb\u30c0\u4ee5\u4e0b\u306b\u3001\u4f5c\u6210\u3057\u305f\u3001tc Server \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u540d\u306e\u30d5\u30a9\u30eb\u30c0\u304c\u3067\u304d\u3042\u304c\u308b\u306e\u3067\u3001\\conf \u30d5\u30a9\u30eb\u30c0\u306e\u4e2d\u306e\u3001context.xml \u3092\u7de8\u96c6\u3059\u308b<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/SpringToolSuiteServerJNDIJDBC_33D\/sts_jndi02.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px\" title=\"sts_jndi02\" border=\"0\" alt=\"sts_jndi02\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/SpringToolSuiteServerJNDIJDBC_33D\/sts_jndi02_thumb.jpg\" width=\"365\" height=\"290\" \/><\/a> <\/p>\n<blockquote>\n<p>server.xml \u3084\u3001Catalina\\localhost\\{\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u540d}.xml \u3092\u7de8\u96c6\u3057\u3066\u3082\u3001\u8d77\u52d5\u306e\u305f\u3073\u306b\u4e0a\u66f8\u304d\u3055\u308c\u3066\u6d88\u3048\u3066\u3057\u307e\u3046\u306e\u3067\u3001context.xml \u306b\u8a18\u8ff0<\/p>\n<\/blockquote>\n<pre class=\"prettyprint linenums\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\r\n&lt;Context docBase=&quot;C:\\springsource\\vfabric-tc-server-developer-2.5.0.RELEASE\\tc_server_1\\wtpwebapps\\mvctest&quot; path=&quot;\/mvctest&quot; reloadable=&quot;true&quot; source=&quot;org.eclipse.jst.jee.server:mvctest&quot;&gt;\r\n\r\n &lt;Resource name=&quot;jdbc\/db2&quot; auth=&quot;Container&quot;\r\n             type=&quot;javax.sql.DataSource&quot; \r\n             driverClassName=&quot;com.ibm.db2.jcc.DB2Driver&quot;\r\n             url=&quot;jdbc:db2:\/\/192.168.10.77:50000\/sample&quot;\r\n             username=&quot;db2inst1&quot; \r\n             password=&quot;xxxxx&quot; \r\n             maxActive=&quot;20&quot; maxIdle=&quot;10&quot;\r\n             maxWait=&quot;-1&quot;\/&gt; \r\n\r\n&lt;\/Context&gt;<\/pre>\n<h2>JDBC \u3092\u7f6e\u304f<\/h2>\n<p>tc Server \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u540d\u306e\u30d5\u30a9\u30eb\u30c0 \u4ee5\u4e0b\u306e\u3001 lib \u30d5\u30a9\u30eb\u30c0\u306b\u3001JDBC \u3092\u7f6e\u3044\u3066\u304a\u304f<\/p>\n<pre class=\"prettyprint linenums\">C:\\springsource\\vfabric-tc-server-developer-2.5.0.RELEASE\\tc_server_1\\lib<\/pre>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/SpringToolSuiteServerJNDIJDBC_33D\/sts_jndi03.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px\" title=\"sts_jndi03\" border=\"0\" alt=\"sts_jndi03\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/SpringToolSuiteServerJNDIJDBC_33D\/sts_jndi03_thumb.jpg\" width=\"300\" height=\"184\" \/><\/a> <\/p>\n<h2>Spring JDBC \u3078\u306e\u53c2\u7167\u8a2d\u5b9a <\/h2>\n<p><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2011\/05\/19\/springsource_tool_suite_spring_mvc_spring_jdbc\">\u3053\u3061\u3089\u3092\u53c2\u7167<\/a>\u3057\u3066\u3001pom.xml \u306b\u8ffd\u8a18\u3002 JDBC \u306f\u3001\u30b3\u30f3\u30c6\u30ca\u304b\u3089\u3001JNDI \u3067\u53d6\u5f97\u3059\u308b\u306e\u3067\u3001pom.xml \u306b\u8ffd\u8a18\u7528\u3002<\/p>\n<h2>\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u30af\u30e9\u30b9\u306e\u5b9f\u88c5\u3001DAO\u30af\u30e9\u30b9\u306e\u4f5c\u6210<\/h2>\n<p><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2011\/05\/19\/springsource_tool_suite_spring_mvc_spring_jdbc\">\u3053\u3061\u3089\u3092\u53c2\u7167<\/a>\u3057\u3066\u3001\u30b3\u30fc\u30c9\u3092\u5b9f\u88c5\u3002<\/p>\n<h2>\u4f9d\u5b58\u6027\u306e\u6ce8\u5165<\/h2>\n<p><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2011\/05\/19\/springsource_tool_suite_spring_mvc_spring_jdbc\">\u3053\u306e\u3068\u304d\u306f\u3001DataSource \u3092 Bean \u3068\u3057\u3066\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5185\u3067\u5b9a\u7fa9\u3057\u3066\u3044\u305f<\/a>\u304c\u3001\u4eca\u56de\u306f\u3001JNDI \u304b\u3089 \u30eb\u30c3\u30af\u30a2\u30c3\u30d7\u3002root-context.xml \u306b\u4ee5\u4e0b\u3092\u8ffd\u8a18\u3002 <a href=\"http:\/\/publib.boulder.ibm.com\/infocenter\/wasinfo\/v7r0\/index.jsp?topic=\/com.ibm.websphere.express.doc\/info\/exp\/ae\/cspr_data_access.html\">\u53c2\u8003<\/a><\/p>\n<pre class=\"prettyprint linenums\">    &lt;bean id=&quot;dataSource&quot; class=&quot;org.springframework.jndi.JndiObjectFactoryBean&quot;&gt;\r\n        &lt;property name=&quot;jndiName&quot; value=&quot;java:comp\/env\/jdbc\/db2&quot;\/&gt;\r\n        &lt;property name=&quot;lookupOnStartup&quot; value=&quot;false&quot;\/&gt;\r\n        &lt;property name=&quot;cache&quot; value=&quot;true&quot;\/&gt;\r\n        &lt;property name=&quot;proxyInterface&quot; value=&quot;javax.sql.DataSource&quot;\/&gt;\r\n    &lt;\/bean&gt;<\/pre>\n<p>\u3042\u3068\u306f\u3001\u57fa\u672c\u7684\u306b\u3001<a href=\"https:\/\/www.typea.info\/blog\/index.php\/2011\/05\/19\/springsource_tool_suite_spring_mvc_spring_jdbc\">\u3053\u3061\u3089\u3068\u540c\u3058\u3002<\/a><\/p>\n<h2>\u5b9f\u884c\u3057\u3066\u307f\u308b\u3002<\/h2>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/SpringToolSuiteServerJNDIJDBC_33D\/sts_jndi04.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px\" title=\"sts_jndi04\" border=\"0\" alt=\"sts_jndi04\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/SpringToolSuiteServerJNDIJDBC_33D\/sts_jndi04_thumb.jpg\" width=\"382\" height=\"262\" \/><\/a> <\/p>\n<p>\u540c\u3058\u7d50\u679c\u304c\u5f97\u3089\u308c\u307e\u3057\u305f\u3002\u3081\u3067\u305f\u3057\u3001\u3081\u3067\u305f\u3057\u3002<\/p>\n<p><iframe style=\"width: 120px; height: 240px\" marginheight=\"0\" src=\"http:\/\/rcm-jp.amazon.co.jp\/e\/cm?lt1=_blank&amp;bc1=FFFFFF&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=typea09-22&amp;o=9&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=ss_til&amp;asins=4797358114\" frameborder=\"0\" marginwidth=\"0\" scrolling=\"no\"><\/iframe><iframe style=\"width: 120px; height: 240px\" marginheight=\"0\" src=\"http:\/\/rcm-jp.amazon.co.jp\/e\/cm?lt1=_blank&amp;bc1=FFFFFF&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=typea09-22&amp;o=9&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=ss_til&amp;asins=4798120545\" frameborder=\"0\" marginwidth=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>&#160;<\/p>\n<p>\u30de\u30b9\u30bf\u30ea\u30f3\u30b0Java EE 5 \u7b2c2\u7248\u6b32\u3057\u3044\u306a-<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spring MVC \u304b\u3089\u3001JDBC\u3092\u8a66\u3057\u305f \u304c\u3001\u6b21\u306f\u3001JDBC \u3092 JNDI \u304b\u3089\u53d6\u5f97\u3057\u3066\u307f\u308b\u3002 tc Server \u306e\u8a2d\u5b9a\u3092\u89e6\u308b\u306e\u3067\u3001\u65b0\u898f\u306b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3059\u308b\u3002 Servers \u30d3\u30e5\u30fc\u304b\u3089\u3001\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u30e1\u30cb\u30e5\u30fc  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"","vkexunit_cta_each_option":"","footnotes":""},"categories":[46,47],"tags":[],"class_list":["post-295","post","type-post","status-publish","format-standard","hentry","category-java-ee","category-spring"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=295"}],"version-history":[{"count":0,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/295\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}