-
파이널프로젝트-5 spring oracle db 연동하기파이널프로젝트 2022. 4. 5. 01:24
package com.eco.persistence; import static org.junit.Assert.fail; import java.sql.Connection; import java.sql.DriverManager; import org.junit.Test; public class JDBCTest { static { try { Class.forName("oracle.jdbc.driver.OracleDriver"); } catch (Exception e) { e.printStackTrace(); } } @Test public void testConnection() { try(Connection con = DriverManager.getConnection( "jdbc:oracle:thin:@IP주소입력:1521:xe", "계정명", "비번")){ System.out.println(con); } catch (Exception e) { fail(e.getMessage()); } } }run as -> junit test 해서 성공하면 완성!!!
db 연결 성공!!!
휴 드뎌 ㅠㅠㅠㅠㅠ
자자 ㅠㅠ....
'파이널프로젝트' 카테고리의 다른 글
<annotation-driven /> 에러 해결하기 (0) 2022.04.06 파이널프로젝트6-필수 패키지 추가하기 (0) 2022.04.06 파이널프로젝트4- DB 에러 잡기 (0) 2022.04.04 파이널 프로젝트-3 git 연동하기 (0) 2022.04.04 파이널 프로젝트-1 (0) 2022.03.28