WON.dev
DBConnect 본문
package org.joonzis.db;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class DBConnect {
public static Connection getConnection() throws ClassNotFoundException, SQLException{
Class.forName("oracle.jdbc.driver.OracleDriver");
String user = "scott";
String password = "tiger";
String url = "jdbc:oracle:thin:@localhost:1521:xe";
Connection conn = DriverManager.getConnection(url, user, password);
return conn;
}
}
'JSP > DB (2)' 카테고리의 다른 글
chapter05 : update (0) | 2023.05.24 |
---|---|
chapter04 : update_one (0) | 2023.05.24 |
chapter03 : remove_one (0) | 2023.05.24 |
chapter02 : insert_one (0) | 2023.05.24 |
chapter01 : index (0) | 2023.05.24 |