WON.dev
chapter01 : DBConnection 본문
package org.joonzis.db;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class DBConnection {
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;
}
}
'JAVA > chapter27_preparestatement' 카테고리의 다른 글
chapter05 : select (0) | 2023.05.31 |
---|---|
chapter04 : delete (0) | 2023.05.31 |
chapter03 : update (0) | 2023.05.31 |
chapter02 : insert (0) | 2023.05.31 |