{"id":686,"date":"2022-10-14T11:15:49","date_gmt":"2022-10-14T02:15:49","guid":{"rendered":"https:\/\/java.ihavenomoney.co.kr\/?page_id=686"},"modified":"2022-12-29T15:04:56","modified_gmt":"2022-12-29T06:04:56","slug":"mysql-connecter","status":"publish","type":"page","link":"https:\/\/java.ihavenomoney.co.kr\/?page_id=686","title":{"rendered":"Mysql connector \uc5f0\uacb0 \uc624\ub958"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Remark : \ub514\ube44 \uc5f0\uacb0\uc774 \ub418\uc9c0 \uc54a\ub294 \ud615\uc0c1<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:&nbsp;Could&nbsp;not&nbsp;create&nbsp;connection&nbsp;to&nbsp;database&nbsp;server<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:java decode:true \">package com.jcg.spring.mvc.file.download;\n\nimport java.io.File;\nimport java.io.FileWriter;\nimport java.io.IOException;\nimport java.sql.Connection;\nimport java.sql.DriverManager;\nimport java.sql.ResultSet;\nimport java.sql.SQLException;\nimport java.sql.Statement;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Properties;\n\nimport org.apache.log4j.Logger;\n\npublic class GenerateCsvData {\n\n\tstatic ResultSet res; \n\tstatic Statement stmt;\n\tstatic Connection conn;\n\n\tprivate static Logger logger = Logger.getLogger(GenerateCsvData.class);\n\n\t\/**** This Method Is Used To Create A Database Connection Object ****\/\n\tpublic static Connection getDatabaseConnection() {\n\t\ttry {\n\t\t\tClass.forName(IConstants.DB_DRIVER);\n\t\t\tconn = DriverManager.getConnection(IConstants.DB_URL, IConstants.DB_USERNAME,IConstants.DB_PASSWORD);\n\t\t\t\n\t\t\t\/\/Properties info = new Properties();\n\t\t\t\/\/info.setProperty(\"user\", IConstants.DB_USERNAME);\n\t\t\t\/\/info.setProperty(\"password\", IConstants.DB_PASSWORD);\n\t\t\t\/\/info.setProperty(\"useSSL\", \"false\");\n\t\t\t\/\/info.setProperty(\"autoReconnect\", \"true\");\n            \/\/conn = DriverManager.getConnection(IConstants.DB_URL, info);\n\t\t\t\n\t\t} catch(Exception exObj) {\n\t\t\tlogger.error(\"Exception While Creating The Db Connection Object?= \" + exObj);\n\t\t}\n\t\treturn conn;\n\t}<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\uc6d0\uc778 :  mysql-connector-java \ubc84\uc804 \uc774 \uc61b\ub0a0 \ubc84\uc804\uc774\ub77c\uc11c \ubc1c\uc0dd.<\/h3>\n\n\n\n<p><strong>[\ud604\uc7ac \uc0ac\uc6a9\ud558\ub294 \ubc84\uc804]<\/strong> MySQL \ubc84\uc804 : 8.0.28 <br><br>mysql-connector-java \ubc84\uc804 : 6.0.23\u00a0 => 8.0.28 jar  \uc5c5\ub370\uc774\ud2b8  <br><br><strong>\uc5c5\ub370\uc774\ud2b8 \ubc29\ubc95 :  <a href=\"https:\/\/java.ihavenomoney.co.kr\/?page_id=671\" data-type=\"page\" data-id=\"671\">pox.xml \uc218\uc815<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Remark : \ub514\ube44 \uc5f0\uacb0\uc774 \ub418\uc9c0 \uc54a\ub294 \ud615\uc0c1 com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:&nbsp;Could&nbsp;not&nbsp;create&nbsp;connection&nbsp;to&nbsp;database&nbsp;server \uc6d0\uc778 : mysql-connector-java \ubc84\uc804 \uc774 \uc61b\ub0a0 \ubc84\uc804\uc774\ub77c\uc11c \ubc1c\uc0dd. [\ud604\uc7ac \uc0ac\uc6a9\ud558\ub294 \ubc84\uc804] MySQL \ubc84\uc804 : 8.0.28 mysql-connector-java \ubc84\uc804 : 6.0.23\u00a0 => 8.0.28 jar \uc5c5\ub370\uc774\ud2b8 \uc5c5\ub370\uc774\ud2b8 \ubc29\ubc95 : pox.xml \uc218\uc815<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-686","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/686","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=686"}],"version-history":[{"count":5,"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/686\/revisions"}],"predecessor-version":[{"id":1112,"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/686\/revisions\/1112"}],"wp:attachment":[{"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}