Notice
Recent Posts
Recent Comments
Link
«   2024/07   »
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 30 31
Tags
more
Archives
Today
Total
관리 메뉴

WON.dev

chapter01 : DBConnection 본문

JAVA/chapter26_statement

chapter01 : DBConnection

GAWON 2023. 5. 31. 09:34
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 > chapter26_statement' 카테고리의 다른 글

chapter04 : select  (0) 2023.05.31
chapter03 : update  (0) 2023.05.31
chapter02 : insert  (0) 2023.05.31