Notice
Recent Posts
Recent Comments
Link
07-26 04:14
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- SQL
- Oracle join
- Class<SpringJUnit4ClassRunner> cannot be resolved to a type
- 이클립스
- 취성패
- git push
- 마크다운 링크
- 한글깨짐
- @Setter(onMethod_ = @Autowired) Error
- oracle
- git
- 오라클
- 오라클연습문제
- SpringJUnit4ClassRunner
- ejected-non-fast-forward
- java.lang.NoClassDefFoundError:org/springframework/core/annotation/MergedAnnotations
- lombok.jar
- 마크다운 테이블
- 스프링
- rest방식
- HTTP 상태 415 – 지원되지 않는 Media Type
- git오류
- jdbc연결테스트코드
- 마크다운 기본문법
- jdbc연결확인
- 마크다운 리스트
- 정보처리기사
- java
- mysql한글깨짐
- spring자바설정
Archives
- Today
- Total
study-project
JDBC 연결확인을 위한 테스트 코드 본문
package org.zerock.persistence;
import static org.junit.Assert.fail;
import java.sql.Connection;
import java.sql.DriverManager;
import org.junit.Test;
import lombok.extern.log4j.Log4j;
@Log4j
public class JDBCTests {
static {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
} catch (Exception e) {
e.printStackTrace();
}
}
@Test
public void testConnection() {
try(Connection con =
DriverManager.getConnection("URL", "아이디", "비밀번호")) {
log.info(con);
} catch (Exception e) {
fail(e.getMessage());
}
}
}
정상적으로 연결 되었다면 log.info(con) 가 콘솔에 객체를 출력해줄 것이다.
'TIL > Spring' 카테고리의 다른 글
[오류]spring Logger cannot be resolved to a type 해결 (0) | 2021.02.23 |
---|---|
[오류]web.xml is missing and <failOnMissingWebXml> is set to true (0) | 2021.02.18 |
[오류]java.lang.NoClassDefFoundError: org/springframework/core/annotation/MergedAnnotations (0) | 2021.02.17 |
[오류]Class<SpringJUnit4ClassRunner> cannot be resolved to a type (0) | 2021.02.17 |
@Setter(onMethod_ = @Autowired) 에러 해결하기 (0) | 2021.02.17 |
Comments