{"id":1183,"date":"2008-08-26T21:48:16","date_gmt":"2008-08-26T12:48:16","guid":{"rendered":"http:\/\/na-inet.jp\/new-na-inet\/weblog\/2008\/08\/826_2\/"},"modified":"2008-08-26T21:48:16","modified_gmt":"2008-08-26T12:48:16","slug":"826_2","status":"publish","type":"post","link":"https:\/\/na-inet.jp\/weblog2\/2008\/08\/26\/826_2\/","title":{"rendered":"8\/26(\u706b) \u639b\u5ddd\u30fb\uff1f"},"content":{"rendered":"<p>\u3000\u3078\u30fc\uff0c<a href=\"http:\/\/www.asahi.com\/science\/update\/0816\/OSK200808160004.html\">\u76f8\u52a0\u76f8\u4e57\u5e73\u5747\u306e\u65b0\u3057\u3044\u8a3c\u660e<\/a>\uff08\u671d\u65e5\u65b0\u805e\uff09\u3068\u306a\u3002\u8ad6\u6587\u306f<a href=\"http:\/\/jipam.vu.edu.au\/images\/080_08_JIPAM\/080_08.pdf?PHPSESSID=467ddef62774733a8e67ff29b63417d4\">\u3053\u308c<\/a>\u3002\u3075\u30fc\u3093\uff0c\u4e00\u756a\u5358\u7d14\u306a\u5e30\u7d0d\u6cd5\u306e\u304a\u624b\u672c\u307f\u305f\u3044\u306d\u3002\u65e9\u901f\u3069\u3063\u304b\u3067\u4f7f\u304a\u3046\u3063\u3068\u3002<br \/>\n\u3000\u4e45\u3005\u306b\u4ed5\u4e8b\u306b\u96c6\u4e2d\u3057\u305f\u65e5\u3002\u3064\u30fc\u3066\u3082\uff0c\u4e38\u3005\u4e00\u6708\u307b\u3063\u305f\u3089\u304b\u3057\u3066\u3044\u305f\u4e8b\u6848\u3092\u7740\u624b\u3057\u305f\u3068\u8a00\u3046\u3060\u3051\u3060\u304c\u3002<br \/>\n\u3000ODBC-ODBC bridge\u3092\u4f7f\u3063\u3066\uff0cWindows\u5074\u306b\u3042\u308bACCESS\u30d5\u30a1\u30a4\u30eb\u3092\uff0cODBC\u7d4c\u7531\u3067\uff0cVine Linux\u5074\u306ePHP\u30b9\u30af\u30ea\u30d7\u30c8\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3044\u3046\u4ef6\u3002\u76f8\u624b\u5074\u304cWindows\u30c9\u30e1\u30a4\u30f3\u7ba1\u7406\u4e0b\u306b\u3042\u308b\u305f\u3081\uff0c\u4f55\u304c\u539f\u56e0\u304b\u5207\u308a\u5206\u3051\u304c\u3067\u304d\u305a\u306b\u3044\u305f\u306e\u3060\u304c\uff0c\u4f55\u3068\u304b\u4e0b\u8a18\u306e\u624b\u9806\u3067\u63a5\u7d9a\u3059\u308b\u307e\u3067\u306f\u3067\u304d\u305f\uff08\u3089\u3057\u3044\uff1f\uff09\u3002<br \/>\n0. <a href=\"http:\/\/www.amy.hi-ho.ne.jp\/jbaba\/brodbc\/brodbc3.htm\">brodbc03.tgz<\/a>\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\uff0cWindows\u5074\u306borbrd.exe(ODBC-ODBC bridge\u30b5\u30fc\u30d0)\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3082\u3089\u3044<\/p>\n<blockquote><p>\t\u30b5\u30fc\u30d0\u306eIP\u30a2\u30c9\u30ec\u30b9<br \/>\n\u30dd\u30fc\u30c8\u756a\u53f7(22002\u304c\u30c7\u30d5\u30a9\u30eb\u30c8)<br \/>\nDSN, Database\u540d, UID, PWD<\/p><\/blockquote>\n<p>\u3092\u6559\u3048\u3066\u3082\u3089\u3046<br \/>\n1. UNIX ODBC\u30c9\u30e9\u30a4\u30d0\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/p>\n<blockquote><p># apt-get install unixODBC unixODBC-devel<\/p><\/blockquote>\n<p>2. brodbc03.tgz\u306e\u3046\u3061, client\/makefile.ux\u3092\u6b21\u306e\u3088\u3046\u306b\u66f8\u304d\u63db\u3048\u308b\u3002<\/p>\n<blockquote><p># unixODBC<br \/>\nODBCLIB = \/usr\/lib\/libodbcinst.so.1.0.0 <-- libodbc\u306b\u306fSQL API\u304c\u306a\u304f\u306a\u3063\u3066\u3044\u305f\u306e\u3067<\/p><\/blockquote>\n<p>3. make\u3057\u3066brodbc.so\u3092\/usr\/lib\u306b\u30b3\u30d4\u30fc<br \/>\n4. \/etc\/odbcinst.ini\u306b\u8ffd\u8a18<\/p>\n<blockquote><p>[brodbc03]<br \/>\nDescription     = ODBC-ODBC bridge<br \/>\nDriver          = \/usr\/local\/lib\/brodbc.so <--\u3053\u3053\nUsageCount      = 1\n<\/p><\/blockquote>\n<p>5. \/etc\/odbc.init\u306b\u8ffd\u8a18(\u307e\u3060\u4e0d\u78ba\u5b9a)<\/p>\n<blockquote><p>[test1]<br \/>\nDriver  = brodbc03<br \/>\nServer  = 192.168.xxx.xxx <-- ODBC\u8a2d\u5b9a\u6e08\u307f\u306eWindows\u30de\u30b7\u30f3\nPort    = xxxxx\nTARGETDSN       = TEST1ODBC\nDatabase = TEST1\nUsername = user\nPassword = user\nServercharset = Shift_jis\nCharset = eucjp\nDebug = 0\n[test2]\nDriver  = brodbc03\nServer  = 192.168.xxx.xxx\nPort    = xxxxx\nTARGETDSN       = TEST2ODBC\nDatabase = TEST2\nUsername = user\nPassword = user\nServercharset = Shift_jis\nCharset = eucjp\nDebug = 0\n<\/p><\/blockquote>\n<p>6. isql\u30b3\u30de\u30f3\u30c9\u3067\u63a5\u7d9a\u78ba\u8a8d<\/p>\n<blockquote><p>$ isql test1<br \/>\n(\u7565)<br \/>\nSQL> <-- \u3053\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u304c\u51fa\u308c\u3070\u304a\u3063\u3051<br \/>\n$ isql test2<br \/>\n(\u7565)<br \/>\nSQL>\n<\/p><\/blockquote>\n<p>7. php-odbc\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<blockquote><p># apt-get install php5-odbc php-odbc<\/p><\/blockquote>\n<p>7&#8242;. Apache2\u3092\u30bd\u30fc\u30b9\u304b\u3089\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3066\u3044\u308b\u5834\u5408\u306f\uff0cPHP\u3082<\/p>\n<blockquote><p>.\/configure &#8211;prefix=\/usr\/local\/apache2 &#8211;with-apxs2=\/usr\/local\/apache2\/bin\/apxs &#8211;with-unixODBC &#8211;with-mysql\n<\/p><\/blockquote>\n<p>\u3068\u3084\u3063\u3066\u4f5c\u308a\u76f4\u3057\u3066\u304a\u304f\u3002<br \/>\n8. php\u304b\u3089\u63a5\u7d9a\u30c6\u30b9\u30c8<\/p>\n<blockquote><p>\/\/\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3078\u306e\u63a5\u7d9a\u3092\u958b\u304f<br \/>\n$conn_id = odbc_connect(&#8220;test1&#8221;, &#8220;user&#8221;, &#8220;user&#8221;);<br \/>\nif(!$conn_id)<br \/>\n{<br \/>\n\u3000print &#8220;\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u3064\u306a\u304c\u308a\u307e\u305b\u3093\\n&#8221;;<br \/>\n\u3000exit;<br \/>\n}<br \/>\n\/\/ SQL Query\u767a\u884c<br \/>\n$result = odbc_do($conn_id, &#8220;SQL\u6587&#8221;);<br \/>\nif(!$result)<br \/>\n{<br \/>\n\u3000print &#8220;\u8b66\u544a!: \u7d50\u679c\u304c\u6b63\u3057\u304f\u623b\u3063\u3066\u304d\u307e\u305b\u3093.\\n&#8221;;<br \/>\n}<br \/>\nelse<br \/>\n{<br \/>\n\u3000while(odbc_fetch_row($result))<br \/>\n\u3000{<br \/>\n\u3000\u3000print odbc_result($result, 1) . &#8220;, &#8221; . odbc_result($result, 2) . &#8220;\\n&#8221;;<br \/>\n\u3000}<br \/>\n}<br \/>\n\/\/\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3078\u306e\u63a5\u7d9a\u3092\u9589\u3058\u308b<br \/>\n$ret = odbc_close($conn_id);\n<\/p><\/blockquote>\n<p>\u3000\u30cf\u30fc\u3081\u3093\u3069\u304f\u3055\u3002\u3053\u308c\u3067\u3082\u307e\u3060\u30a2\u30af\u30bb\u30b9\u304c\u304d\u3061\u3093\u3068\u78ba\u8a8d\u3067\u304d\u305f\u304b\u4e0d\u660e\u3002\u4e00\u6b69\u524d\u9032\u3060\u3068\u306f\u601d\u3046\u304c\u5b8c\u5168\u89e3\u6c7a\u3078\u306e\u9053\u306e\u308a\u306f\u9577\u305d\u3046\u3060\u3002<br \/>\n[2008-08-27 \u8ffd\u8a18] \u7121\u4e8b\u63a5\u7d9a\u78ba\u8a8d\u3067\u304d\u307e\u3057\u305f\u3002\u3057\u304b\u3057\u30fb\u30fb\u30fb\u4f7f\u3048\u308bSQL\u6587\u306b\u5236\u9650\u304c\u3042\u308b\u306e\u3063\u3066\u3082\u306e\u3059\u3054\u304f\u4e0d\u81ea\u7531\u3060\u3002\u6240\u8a6e\uff0cODBC\u306fSQL\u306e\u30b5\u30d6\u30bb\u30c3\u30c8\u3057\u304b\u30b5\u30dd\u30fc\u30c8\u3067\u304d\u3066\u306a\u3044\u304b\u3089\uff0c\u3057\u3083\u30fc\u306a\u3044\u306e\u3060\u304c\u3002<br \/>\n\u3000\u3055\u3066\uff0c\u5ba2\u4eba\u3092\u8fce\u3048\u306b\u884c\u3063\u3066\u304b\u3089\u5bdd\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3000\u3078\u30fc\uff0c\u76f8\u52a0\u76f8\u4e57\u5e73\u5747\u306e\u65b0\u3057\u3044\u8a3c\u660e\uff08\u671d\u65e5\u65b0\u805e\uff09\u3068\u306a\u3002\u8ad6\u6587\u306f\u3053\u308c\u3002\u3075\u30fc\u3093\uff0c\u4e00\u756a\u5358\u7d14\u306a\u5e30\u7d0d\u6cd5\u306e\u304a\u624b\u672c\u307f\u305f\u3044\u306d\u3002\u65e9\u901f\u3069\u3063\u304b\u3067\u4f7f\u304a\u3046\u3063\u3068\u3002 \u3000\u4e45\u3005\u306b\u4ed5\u4e8b\u306b\u96c6\u4e2d\u3057\u305f\u65e5\u3002\u3064\u30fc\u3066\u3082\uff0c\u4e38\u3005\u4e00\u6708\u307b\u3063\u305f\u3089\u304b\u3057\u3066\u3044\u305f\u4e8b\u6848\u3092\u7740\u624b\u3057\u305f\u3068\u8a00\u3046\u3060\u3051\u3060\u304c &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/na-inet.jp\/weblog2\/2008\/08\/26\/826_2\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;8\/26(\u706b) \u639b\u5ddd\u30fb\uff1f&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[2],"tags":[],"class_list":["post-1183","post","type-post","status-publish","format-standard","hentry","category-2"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/na-inet.jp\/weblog2\/wp-json\/wp\/v2\/posts\/1183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/na-inet.jp\/weblog2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/na-inet.jp\/weblog2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/na-inet.jp\/weblog2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/na-inet.jp\/weblog2\/wp-json\/wp\/v2\/comments?post=1183"}],"version-history":[{"count":0,"href":"https:\/\/na-inet.jp\/weblog2\/wp-json\/wp\/v2\/posts\/1183\/revisions"}],"wp:attachment":[{"href":"https:\/\/na-inet.jp\/weblog2\/wp-json\/wp\/v2\/media?parent=1183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/na-inet.jp\/weblog2\/wp-json\/wp\/v2\/categories?post=1183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/na-inet.jp\/weblog2\/wp-json\/wp\/v2\/tags?post=1183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}