{"id":2870,"date":"2009-06-09T12:00:41","date_gmt":"2009-06-09T12:00:41","guid":{"rendered":"http:\/\/www.happyfam.or.kr\/ysoh\/jdbc-%eb%93%9c%eb%9d%bc%ec%9d%b4%eb%b2%84%ec%99%80-%ed%95%9c%ea%b8%80-%ea%b9%a8%ec%a7%90-%ed%95%b4%ea%b2%b0\/"},"modified":"2015-02-10T21:12:15","modified_gmt":"2015-02-10T12:12:15","slug":"jdbc-%eb%93%9c%eb%9d%bc%ec%9d%b4%eb%b2%84%ec%99%80-%ed%95%9c%ea%b8%80-%ea%b9%a8%ec%a7%90-%ed%95%b4%ea%b2%b0","status":"publish","type":"post","link":"https:\/\/www.happyfam.or.kr\/ysoh\/jdbc-%eb%93%9c%eb%9d%bc%ec%9d%b4%eb%b2%84%ec%99%80-%ed%95%9c%ea%b8%80-%ea%b9%a8%ec%a7%90-%ed%95%b4%ea%b2%b0\/","title":{"rendered":"JDBC \ub4dc\ub77c\uc774\ubc84\uc640 \ud55c\uae00 \uae68\uc9d0 \ud574\uacb0"},"content":{"rendered":"<p><DIV>JSP \ud504\ub85c\uadf8\ub7a8\uc5d0\uc11c MySQL\uc6a9 JDBC \ub4dc\ub77c\uc774\ubc84\ub97c \uc774\uc6a9 \ud3fc\uc73c\ub85c \ubd80\ud130 POST \uba54\uc18c\ub4dc\ub85c \uc804\ub2ec\ub41c \ud55c\uae00 \ub370\uc774\ud130\ub97c Insert \ud560 \ub54c \ud55c\uae00\uc774 \uae68\uc9c4\ub2e4\uba74 \ud398\uc774\uc9c0 \ubb38\uc790\uc14b\uc744 \uace0\ub824\ud558\uc5ec \uc5f0\uacb0 URL\uc744 \ub2e4\uc74c\uacfc \uac19\uc774 \uc9c0\uc815\ud55c\ub2e4. \uadf8\ub7ec\uba74 \ud55c\uae00\uc774 \uae68\uc9c0\uc9c0 \uc54a\uc740 \ub370\uc774\ud130\ub97c \ud14c\uc774\ube14\uc5d0 \uc798 \uc800\uc7a5\ud560 \uc218 \uc788\ub2e4. \ubb3c\ub860 request.setCharacterEncoding \uba54\uc18c\ub4dc\uc758 \ud30c\ub77c\uba54\ud130\ub3c4 \ubb38\uc790\uc14b\uc5d0 \ub9de\ub3c4\ub85d \uc62c\ubc14\ub974\uac8c \uc9c0\uc815\ud574\uc57c \ud558\uace0&#8230;<\/DIV><br \/>\n<DIV>&nbsp;<\/DIV><br \/>\n<DIV>\ud398\uc774\uc9c0 \ubb38\uc790\uc14b\uc774 &#8220;EUC-KR&#8221; \uc778 \uacbd\uc6b0<\/DIV><br \/>\n<DIV><br \/>\n<DIV><br \/>\n<DIV>request.setCharacterEncoding(&#8220;<STRONG><FONT color=\"#0000ff\">euc-kr<\/FONT><\/STRONG>&#8220;);<\/DIV><br \/>\n<DIV>&#8230;<\/DIV>String jdbc_url = &#8220;jdbc:mysql:\/\/localhost:3306\/jsp_test?useUnicode=true&amp;characterEncoding=<STRONG><FONT color=\"#0000ff\">euckr<\/FONT><\/STRONG>&#8220;;<\/DIV><\/DIV><br \/>\n<DIV><BR><BR>\ud398\uc774\uc9c0 \ubb38\uc790\uc14b\uc774 &#8220;UTF-8&#8221; \uc778 \uacbd\uc6b0<\/DIV><br \/>\n<DIV><br \/>\n<DIV><br \/>\n<DIV>request.setCharacterEncoding(&#8220;<STRONG><FONT color=\"#0000ff\">utf-8<\/FONT><\/STRONG>&#8220;);<\/DIV><br \/>\n<DIV>&#8230;<\/DIV><br \/>\n<DIV>String jdbc_url = &#8220;jdbc:mysql:\/\/localhost:3306\/jsp_test?useUnicode=true&amp;characterEncoding=<STRONG><FONT color=\"#0000ff\">utf8<\/FONT><\/STRONG>&#8220;;<\/DIV><\/DIV><\/DIV><br \/>\n<DIV><BR>\ub9cc\uc57d MySQL \uc11c\ubc84\uac00 4.x \uae4c\uc9c0\uc758 \ubc84\uc804 \uc774\ub77c\uba74 URL\uc5d0\uc11c &#8220;euckr&#8221;\uacfc &#8220;utf8&#8221; \ubd80\ubd84\uc744 \uac01\uac01 &#8220;euc-kr&#8221;, &#8220;utf-8&#8243;\ub85c \ubc14\uafd4\uc918\uc57c \ud55c\ub2e4.<BR><BR>\uc544\ub798 \uc608\uc81c \ud504\ub85c\uadf8\ub7a8\uc744 \ucc38\uc870\ud558\uc790.<BR><BR>\ud398\uc774\uc9c0 \ubb38\uc790\uc14b\uc774 &#8220;EUC-KR&#8221;\uc778 \uacbd\uc6b0.<BR><BR>form.html<BR><br \/>\n<DIV>&lt;!DOCTYPE html PUBLIC &#8220;-\/\/W3C\/\/DTD HTML 4.01 Transitional\/\/EN&#8221; <BR>&#8220;http:\/\/www.w3.org\/TR\/html4\/loose.dtd&#8221;&gt;<BR>&lt;html&gt;<BR>&lt;head&gt;<BR>&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text\/html; charset=<STRONG>EUC-KR<\/STRONG>&#8220;&gt;<BR>&lt;title&gt;Insert title here&lt;\/title&gt;<BR>&lt;\/head&gt;<BR>&lt;body&gt;<BR>&lt;form action=&#8221;regdb.jsp&#8221; method=&#8221;post&#8221;&gt;<BR>\uc774\ub984 : &lt;input type=&#8221;text&#8221; name=&#8221;name&#8221; \/&gt;<BR>&lt;input type=&#8221;submit&#8221; value=&#8221;\uc800\uc7a5&#8221; \/&gt;<BR>&lt;\/form&gt;<BR>&lt;\/body&gt;<BR>&lt;\/html&gt;<\/DIV><BR>regdb.jsp<BR><br \/>\n<DIV><br \/>\n<DIV>&lt;%@ page language=&#8221;java&#8221; contentType=&#8221;text\/html; charset=<STRONG>EUC-KR<\/STRONG>&#8220;<BR>&nbsp; &nbsp; pageEncoding=&#8221;<STRONG>EUC-KR<\/STRONG>&#8220;%&gt;<BR>&lt;%@ page import=&#8221;java.sql.*&#8221; %&gt;<BR>&lt;!DOCTYPE html PUBLIC &#8220;-\/\/W3C\/\/DTD HTML 4.01 Transitional\/\/EN&#8221; <BR>&#8220;http:\/\/www.w3.org\/TR\/html4\/loose.dtd&#8221;&gt;<BR>&lt;html&gt;<BR>&lt;head&gt;<BR>&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text\/html; charset=<STRONG>EUC-KR<\/STRONG>&#8220;&gt;<BR>&lt;title&gt;Insert title here&lt;\/title&gt;<BR>&lt;\/head&gt;<BR>&lt;body&gt;<BR>&lt;%<BR>request.setCharacterEncoding(&#8220;<STRONG>euc-kr<\/STRONG>&#8220;);<\/DIV><br \/>\n<DIV>Connection conn = null;<BR>Statement stmt = null;<\/DIV><br \/>\n<DIV>String jdbc_driver = &#8220;com.mysql.jdbc.Driver&#8221;;<BR>String jdbc_url &nbsp;&nbsp; = &#8220;jdbc:mysql:\/\/localhost:3306\/jsp_test?useUnicode=true&amp;characterEncoding=<STRONG>euckr<\/STRONG>&#8220;;<BR>String jdbc_user &nbsp; = &#8220;jsp_test&#8221;;<BR>String jdbc_pwd &nbsp;&nbsp; = &#8220;jsp_test&#8221;;<\/DIV><br \/>\n<DIV>String sql&nbsp; = null;<\/DIV><br \/>\n<DIV>String name = request.getParameter(&#8220;name&#8221;);<\/DIV><br \/>\n<DIV>sql = &#8220;INSERT INTO member_euckr VALUES (&#8216;&#8221; + name + &#8220;&#8216;)&#8221;;<\/DIV><br \/>\n<DIV>Class.forName(jdbc_driver);<\/DIV><br \/>\n<DIV>conn = DriverManager.getConnection(jdbc_url, jdbc_user, jdbc_pwd);<BR>stmt = conn.createStatement();<BR>stmt.executeUpdate(sql);<BR>%&gt;<BR>&lt;%= sql %&gt;&lt;br&gt;<BR>\ub2f9\uc2e0\uc758 \uc774\ub984\uc740<BR>&lt;%= name %&gt;<BR>\uc785\ub2c8\ub2e4.<BR>&lt;\/body&gt;<BR>&lt;\/html&gt;<\/DIV><\/DIV><BR><BR>\ud398\uc774\uc9c0 \ubb38\uc790\uc14b\uc774 &#8220;UTF-8&#8243;\uc778 \uacbd\uc6b0.<BR><BR>form.html<BR><br \/>\n<DIV>&lt;!DOCTYPE html PUBLIC &#8220;-\/\/W3C\/\/DTD HTML 4.01 Transitional\/\/EN&#8221; <BR>&#8220;http:\/\/www.w3.org\/TR\/html4\/loose.dtd&#8221;&gt;<BR>&lt;html&gt;<BR>&lt;head&gt;<BR>&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text\/html; charset=<STRONG>UTF-8<\/STRONG>&#8220;&gt;<BR>&lt;title&gt;Insert title here&lt;\/title&gt;<BR>&lt;\/head&gt;<BR>&lt;body&gt;<BR>&lt;form action=&#8221;regdb.jsp&#8221; method=&#8221;post&#8221;&gt;<BR>\uc774\ub984 : &lt;input type=&#8221;text&#8221; name=&#8221;name&#8221; \/&gt;<BR>&lt;input type=&#8221;submit&#8221; value=&#8221;\uc800\uc7a5&#8221; \/&gt;<BR>&lt;\/form&gt;<BR>&lt;\/body&gt;<BR>&lt;\/html&gt;<\/DIV><BR>regdb.jsp<BR><br \/>\n<DIV><br \/>\n<DIV>&lt;%@ page language=&#8221;java&#8221; contentType=&#8221;text\/html; charset=<STRONG>UTF-8<\/STRONG>&#8220;<BR>&nbsp; &nbsp; pageEncoding=&#8221;<STRONG>UTF-8<\/STRONG>&#8220;%&gt;<BR>&lt;%@ page import=&#8221;java.sql.*&#8221; %&gt;<BR>&lt;!DOCTYPE html PUBLIC &#8220;-\/\/W3C\/\/DTD HTML 4.01 Transitional\/\/EN&#8221; <BR>&#8220;http:\/\/www.w3.org\/TR\/html4\/loose.dtd&#8221;&gt;<BR>&lt;html&gt;<BR>&lt;head&gt;<BR>&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text\/html; charset=<STRONG>UTF-8<\/STRONG>&#8220;&gt;<BR>&lt;title&gt;Insert title here&lt;\/title&gt;<BR>&lt;\/head&gt;<BR>&lt;body&gt;<BR>&lt;%<BR>request.setCharacterEncoding(&#8220;<STRONG>utf-8<\/STRONG>&#8220;);<\/DIV><br \/>\n<DIV>Connection conn = null;<BR>Statement stmt = null;<\/DIV><br \/>\n<DIV>String jdbc_driver = &#8220;com.mysql.jdbc.Driver&#8221;;<BR>String jdbc_url &nbsp;&nbsp; = &#8220;jdbc:mysql:\/\/localhost:3306\/jsp_test?useUnicode=true&amp;characterEncoding=<STRONG>utf8<\/STRONG>&#8220;;<BR>String jdbc_user &nbsp; = &#8220;jsp_test&#8221;;<BR>String jdbc_pwd &nbsp;&nbsp; = &#8220;jsp_test&#8221;;<\/DIV><br \/>\n<DIV>String sql&nbsp; = null;<\/DIV><br \/>\n<DIV>String name = request.getParameter(&#8220;name&#8221;);<\/DIV><br \/>\n<DIV>sql = &#8220;INSERT INTO member_utf VALUES (&#8216;&#8221; + name + &#8220;&#8216;)&#8221;;<\/DIV><br \/>\n<DIV>Class.forName(jdbc_driver);<\/DIV><br \/>\n<DIV>conn = DriverManager.getConnection(jdbc_url,jdbc_user, jdbc_pwd);<BR>stmt = conn.createStatement();<BR>stmt.executeUpdate(sql);<BR>%&gt;<BR>&lt;%= sql %&gt;&lt;br&gt;<BR>\ub2f9\uc2e0\uc758 \uc774\ub984\uc740<BR>&lt;%= name %&gt;<BR>\uc785\ub2c8\ub2e4.<BR>&lt;\/body&gt;<BR>&lt;\/html&gt;<\/DIV><\/DIV><BR><BR>\uc704 \uc608\uc81c\uc5d0\uc11c \uc0ac\uc6a9\ub41c \ub450 \ud14c\uc774\ube14 member_euckr\uacfc member_utf\uc758 \uad6c\uc870\ub294 \uac01\uac01 \ub2e4\uc74c\uacfc \uac19\ub2e4.<BR><BR><br \/>\n<DIV>CREATE TABLE `member_euckr` (<BR>&nbsp; `name` varchar(20) NOT NULL<BR>) DEFAULT CHARSET=euckr;<\/DIV><BR><br \/>\n<DIV>CREATE TABLE `member_utf` (<BR>&nbsp; `name` varchar(20) NOT NULL<BR>) DEFAULT CHARSET=utf8;<\/DIV><\/DIV><\/p>\n","protected":false},"excerpt":{"rendered":"<p>JSP \ud504\ub85c\uadf8\ub7a8\uc5d0\uc11c MySQL\uc6a9 JDBC \ub4dc\ub77c\uc774\ubc84\ub97c \uc774\uc6a9 \ud3fc\uc73c\ub85c \ubd80\ud130 POST \uba54\uc18c\ub4dc\ub85c \uc804\ub2ec\ub41c \ud55c\uae00 \ub370\uc774\ud130\ub97c Insert \ud560 \ub54c \ud55c\uae00\uc774 \uae68\uc9c4\ub2e4\uba74 \ud398\uc774\uc9c0 \ubb38\uc790\uc14b\uc744 \uace0\ub824\ud558\uc5ec \uc5f0\uacb0 URL\uc744 \ub2e4\uc74c\uacfc \uac19\uc774 \uc9c0\uc815\ud55c\ub2e4. \uadf8\ub7ec\uba74 \ud55c\uae00\uc774 \uae68\uc9c0\uc9c0 \uc54a\uc740 \ub370\uc774\ud130\ub97c \ud14c\uc774\ube14\uc5d0 \uc798 \uc800\uc7a5\ud560 \uc218 \uc788\ub2e4. \ubb3c\ub860 request.setCharacterEncoding \uba54\uc18c\ub4dc\uc758 \ud30c\ub77c\uba54\ud130\ub3c4 \ubb38\uc790\uc14b\uc5d0 \ub9de\ub3c4\ub85d \uc62c\ubc14\ub974\uac8c \uc9c0\uc815\ud574\uc57c \ud558\uace0&#8230; &nbsp; \ud398\uc774\uc9c0 \ubb38\uc790\uc14b\uc774 &#8220;EUC-KR&#8221; \uc778 \uacbd\uc6b0 request.setCharacterEncoding(&#8220;euc-kr&#8220;); &#8230;String jdbc_url =\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.happyfam.or.kr\/ysoh\/jdbc-%eb%93%9c%eb%9d%bc%ec%9d%b4%eb%b2%84%ec%99%80-%ed%95%9c%ea%b8%80-%ea%b9%a8%ec%a7%90-%ed%95%b4%ea%b2%b0\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_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":[244],"tags":[28,29,34],"class_list":["post-2870","post","type-post","status-publish","format-standard","hentry","category-jsp","tag-jdbc","tag-jsp","tag-mysql"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p776QY-Ki","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.happyfam.or.kr\/ysoh\/wp-json\/wp\/v2\/posts\/2870","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.happyfam.or.kr\/ysoh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.happyfam.or.kr\/ysoh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.happyfam.or.kr\/ysoh\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.happyfam.or.kr\/ysoh\/wp-json\/wp\/v2\/comments?post=2870"}],"version-history":[{"count":0,"href":"https:\/\/www.happyfam.or.kr\/ysoh\/wp-json\/wp\/v2\/posts\/2870\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.happyfam.or.kr\/ysoh\/wp-json\/wp\/v2\/media?parent=2870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.happyfam.or.kr\/ysoh\/wp-json\/wp\/v2\/categories?post=2870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.happyfam.or.kr\/ysoh\/wp-json\/wp\/v2\/tags?post=2870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}