231228 HTML DBConnection.java
2024. 1. 2. 18:45ㆍ2023.11.21-2024.05.31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
package conn.sukgi.db;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class DBConnection {
public Connection getConn() {
Connection connection = null;
try {//수정할 일이 없어서 스트링 부분을 파이널로 해버려도 된다.
Class.forName("org.mariadb.jdbc.Driver");
String url = "jdbc:mariadb://guro.wisejia.com:3308/c23c_22";
String user = "c23c_22";
String pw = "01234567";
connection = DriverManager.getConnection(url, user, pw);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
return connection;
}
}
|
cs |
'2023.11.21-2024.05.31' 카테고리의 다른 글
231228 HTML BoardDTO.java (0) | 2024.01.02 |
---|---|
231228 HTML Team.java (0) | 2024.01.02 |
231228 HTML main.jsp (0) | 2024.01.02 |
231228 HTML board.jsp (1) | 2024.01.02 |
231228 HTML index.jsp (2) | 2024.01.02 |