tomcat (1) 썸네일형 리스트형 커넥션 풀(사용법)-Oracle 기준 WEB-INF 파일 안에 context.xml 파일을 하나 생성하고 를 입력 후 저장하고 DB연결을 할 class 파일에 Connection conn = null; public UserDAO() throws NamingException, SQLException { Context init = new InitialContext(); DataSource ds = (DataSource) init.lookup("java:comp/env/jdbc/OracleDB"); conn = ds.getConnection(); } 를 넣으면 UserDAO라는 class파일에 DB연동이 성공된다. 이전 1 다음