포트번호 : 1521
SID명 : ORCL
ID/PW : scott/tiger
IP : localhost(or 127.0.0.1)
package DBConnection;
import! java.sql.*;
public class DBConnection{
String url = "jdbc:oracle:thin:@localhost:1521:ORCL";
String driver = "oracle.jdbc.OracleDriver";
public Connection getConnection(){
Connection con = null;
try{
Class.forName(driver);
con = DriverManager.getConnection(url, "scott", "tiger");
}catch(Exception e){
System.out.println("Connection Failed : "+e);}
return con;
}//getConnection메소드 끝
}
호출은 알아서!!
'Oracle' 카테고리의 다른 글
DROP된 테이블, 테이블스페이스 FLASHBACK 기능으로 복구하기. (0) | 2011.05.04 |
---|---|
explain plan. plan table 생성 및 실행계획 확인법 (0) | 2011.04.27 |
자주 참조하는 DB dictionary (0) | 2010.07.02 |
HWM (0) | 2009.10.18 |
현재 날짜 가져오기! (1) | 2009.10.18 |