1. MySQL ์ค์น ๋ฐฉ๋ฒ
MySQL
MySQL HeatWave is a fully managed database service for transactions, real- time analytics across data warehouses and data lakes, and machine learning services, without the complexity, latency, and cost of ETL duplication. It is available on OCI, AWS, and A
www.mysql.com

๋ค์ด๋ก๋ ํด๋ฆญํ๊ธฐ

ํ๋จ์ MySQL Community (GPL) Downloads » ํด๋ฆญํ๊ธฐ


ํด๋ฆญ


์ค์นํ์ผ ๋ค์ด๊ฐ๋ฅํ๋ค.





Next

๊ด๋ฆฌ์ ๋น๋ฐ๋ฒํธ ์ค์ ํด์ค๋๋ค.
Next

Excute ํด๋ฆญ

Next -> finish
workbench ์ค์น







์ค์น์ ์ค์ ํ ๋น๋ฐ๋ฒํธ ์ ๋ ฅํ๊ธฐ


2.์ดํด๋ฆฝ์ค ์ฐ๊ฒฐ
JDBC :์๋ฐ์์ ํ๋ก๊ทธ๋๋ฐ์ ํ๊ธฐ ์ํด ์ฌ์ฉ๋๋ API
JDBC ๋๋ผ์ด๋ฒ ํ์ํจ
์ดํด๋ฆฝ์ค lib์ ๋ฃ์ด์ผํจ
https://downloads.mysql.com/archives/c-j/
MySQL :: Download MySQL Connector/J (Archived Versions)
Please note that these are old versions. New releases will have recent bug fixes and features! To download the latest release of MySQL Connector/J, please visit MySQL Downloads. MySQL open source software is provided under the GPL License.
downloads.mysql.com
c๋๋ผ์ด๋ธ -> apache-tomcat ->lib ๋ถ์ฌ๋ฃ


NEW SCHEMAS ์์ฑ simpledb
์ดํด๋ฆฝ์ค -> ์น ํ๋ก์ ํธ ์์ฑ


Connect servlet์์ฑํ๊ธฐ
package demo;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/Connect")
public class Connect extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// ํ๊ธ์ค์
response.setContentType("text/html; charset=UTF-8");// ์ถ๋ ฅ ์ ํ๊ธ์ค์
// response = ํ๊ธ์ ์ถ๋ ฅํ ๋
// request = ํ๊ธ์ ์ฝ์ด์ฌ๋
PrintWriter out = response.getWriter();
Connection conn = null;
// "jdbc:mysql://localhost:3306/์คํค๋ง์ด๋ฆ?useSSL=false";
String url = "jdbc:mysql://localhost:3306/simpledb?useSSL=false";
String user = "root";// ์ ์ ์ ์
String password = "1234";// ๋น๋ฐ ๋ฒํธ
try {
conn = DriverManager.getConnection(url, user, password);
out.println("DB ์ฐ๊ฒฐ ์๋ฃ!");
} catch (SQLException e) {
out.println("DB์ ์ฐ๊ฒฐํ ์ ์์ต๋๋ค.");
return;
}
try {
conn.close();
} catch (SQLException e) {
}
}
}

'DB' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| [programmers] SQL(MySQL) <SELECT,GROUPBY,HAVING> ์ฌ๊ตฌ๋งค๊ฐ ์ผ์ด๋ ์ํ๊ณผ ํ์ ๋ฆฌ์คํธ ๊ตฌํ๊ธฐ (0) | 2024.01.31 |
|---|