<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>連結資料庫 &#8211; 記下來</title>
	<atom:link href="https://noter.tw/tag/%E9%80%A3%E7%B5%90%E8%B3%87%E6%96%99%E5%BA%AB/feed/" rel="self" type="application/rss+xml" />
	<link>https://noter.tw</link>
	<description>一路上踩到的坑、遇到的問題，一點一滴記下來，希望能幫助到需要的人~</description>
	<lastBuildDate>Tue, 14 Mar 2023 03:52:40 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.3</generator>

<image>
	<url>https://noter.tw/wp-content/uploads/cropped-old-1130742_1920-1-32x32.jpg</url>
	<title>連結資料庫 &#8211; 記下來</title>
	<link>https://noter.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>JSP 連結 MySQL</title>
		<link>https://noter.tw/2889/jsp-%e9%80%a3%e7%b5%90-mysql/</link>
					<comments>https://noter.tw/2889/jsp-%e9%80%a3%e7%b5%90-mysql/#respond</comments>
		
		<dc:creator><![CDATA[黃小蛙]]></dc:creator>
		<pubDate>Mon, 03 Jun 2013 15:18:16 +0000</pubDate>
				<category><![CDATA[資料庫]]></category>
		<category><![CDATA[網頁後端]]></category>
		<category><![CDATA[連結資料庫]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[connector]]></category>
		<category><![CDATA[JSP]]></category>
		<guid isPermaLink="false">http://wazai.net/?p=2889</guid>

					<description><![CDATA[<p>Java 連結 MySQL 的方法 記錄用Java連結MySQL資料庫的方法，這篇要介紹JSP如何連結MySQL。這篇文章是從舊部落格移到這邊記錄留存。步驟：安裝MySQL =&#62; 安裝ODBC &#46;&#46;&#46;</p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/2889/jsp-%e9%80%a3%e7%b5%90-mysql/" data-wpel-link="internal">JSP 連結 MySQL</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://noter.tw/2883" target="_blank" rel="noopener noreferrer" data-wpel-link="internal">Java 連結 MySQL 的方法</a> 記錄用Java連結MySQL資料庫的方法，這篇要介紹JSP如何連結MySQL。這篇文章是從舊部落格移到這邊記錄留存。<br /><span id="more-2889"></span><br />步驟：安裝MySQL =&gt; 安裝ODBC =&gt; 安裝JDBC。</p>
<ul>
<li>
<h2>安裝 MySQL</h2>
<ul>
<li>進入 MySQL 下載頁面，http://dev.mysql.com/downloads/mysql/5.0.html。</li>
<li>依自己的平台選擇下載類型，若是 Win 環境，可下載 Windows Essentials 安裝檔或是不包含安裝檔的 Without installer 這項。</li>
<li>下載完之後，擊點兩下開始安裝。(期間會有些 MySQL Server 的設定)</li>
</ul>
</li>
<li>
<h2>安裝 ODBC</h2>
<ul>
<li>下載 ODBC，http://dev.mysql.com/downloads/connector/odbc/5.1.html。</li>
<li>安裝 ODBC。</li>
<li>安裝完成後，開啟 &#8220;控制台&#8221; -&gt; &#8220;系統管理工具&#8221; -&gt; &#8220;資料來源(ODBC)&#8221;，之後切換到 &#8220;系統資料來源名稱&#8221; 頁面下，看是否有 &#8220;MySQL&#8221;，有的話表示安裝成功。</li>
<li>沒有的話，選擇右邊的 &#8220;新增&#8221; -&gt; &#8220;MySQL ODBC 5.1 Driver&#8221; -&gt; &#8220;完成&#8221;，到這裡會跳出一個 MySQL 設定的視窗，&#8221;Data Source Name&#8221; 隨便輸入，下面包括 &#8220;Server/Port/User/Password&#8221; 都依照安裝 MySQL 時的設定輸入，之後按下 &#8220;Test&#8221;，出現 &#8220;Connection Successful&#8221; 表示整個安裝已經完成了。</li>
</ul>
</li>
<li>
<h2>安裝 JDBC</h2>
<ul>
<li>下載 JDBC，http://dev.mysql.com/downloads/connector/j/5.1.html。</li>
<li>下載完成後解壓縮，找到裡面有個檔名是 &#8220;mysql-connector-java-5.1.6-bin.jar&#8221; 的資料，複製到 Tomcat 安裝目錄下的 &#8220;\shared\lib&#8221; 下。</li>
<li>設計 JSP 文件時，用以下指令就可以連結資料庫。
<pre class="brush: java; gutter: true">String JDBCDriver = "com.mysql.jdbc.Driver";
String strUrl = "jdbc:mysql://localhost:3306/test?user=root&amp;characterEncoding=big5"
Class.forName(JDBCDriver);
Connection con = DriverManager.getConnection(strUrl);</pre>
</li>
</ul>
</li>
</ul>
<p><strong>參考資料：</strong></p>
<ul>
<li style="list-style-type: none;">
<ol>
<li><a href="https://noter.tw/2883" data-wpel-link="internal">Java 連結 MySQL</a></li>
<li><a href="https://noter.tw/1988" data-wpel-link="internal">Java 連結遠端 MySQL</a></li>
</ol>
</li>
</ul>


<p><strong>MySQL / MariaDB / Oracle 相關文章：</strong></p>



<ul class="my-li bg-darkblue wp-block-list">
<li><a href="https://noter.tw/12503/mariadb-json_extract-%e5%be%9e-json-%e6%ac%84%e4%bd%8d%e5%8f%96%e5%80%bc/" data-wpel-link="internal">MariaDB JSON_EXTRACT: 從 JSON 欄位取值</a></li>



<li><a href="https://noter.tw/12015/oracle-%e5%88%86%e7%b5%84%e7%b7%a8%e8%99%9f%e8%88%87%e5%85%a8%e6%8e%92%e5%ba%8f%e7%b7%a8%e8%99%9f-row_number-over-partition-by/" data-wpel-link="internal">Oracle, MySQL 分組編號與全排序編號 row_number, over, partition by</a></li>



<li><a href="https://noter.tw/3929/mysql-error-2003-hy000-%E7%84%A1%E6%B3%95%E9%81%A0%E7%AB%AF%E9%80%A3%E7%B7%9A/" data-wpel-link="internal">MySQL ERROR 2003 (HY000) 無法遠端連線</a></li>



<li><a href="https://noter.tw/2889/jsp-%E9%80%A3%E7%B5%90-mysql/" data-wpel-link="internal">JSP 連結 MySQL</a></li>



<li><a href="https://noter.tw/2883/java-%E9%80%A3%E7%B5%90-mysql/" data-wpel-link="internal">Java 連結 MySQL</a></li>



<li><a href="https://noter.tw/2306/mysql%E6%8E%92%E7%A8%8Bevent-scheduler/" data-wpel-link="internal">MySQL 排程(Event Scheduler)</a></li>



<li><a href="https://noter.tw/1988/java%E9%80%A3%E7%B5%90%E9%81%A0%E7%AB%AFmysql/" data-wpel-link="internal">Java 連結遠端 MySQL</a></li>



<li><a href="https://noter.tw/4508/mariadb-replication-%E8%A8%AD%E5%AE%9A/" data-wpel-link="internal">MariaDB Replication 設定</a></li>



<li><a href="https://noter.tw/122/java-php-%E6%8F%92%E5%85%A5-emoji-%E8%B3%87%E6%96%99%E5%88%B0-mariadb/" data-wpel-link="internal">Java / PHP 插入 emoji 資料到 MariaDB</a></li>
</ul>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/2889/jsp-%e9%80%a3%e7%b5%90-mysql/" data-wpel-link="internal">JSP 連結 MySQL</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://noter.tw/2889/jsp-%e9%80%a3%e7%b5%90-mysql/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
