Notice
Recent Posts
Recent Comments
Link
12-22 21:16
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- @Setter(onMethod_ = @Autowired) Error
- git오류
- SQL
- oracle
- spring자바설정
- SpringJUnit4ClassRunner
- 마크다운 링크
- jdbc연결확인
- 마크다운 기본문법
- mysql한글깨짐
- lombok.jar
- HTTP 상태 415 – 지원되지 않는 Media Type
- Class<SpringJUnit4ClassRunner> cannot be resolved to a type
- 오라클
- 마크다운 테이블
- java.lang.NoClassDefFoundError:org/springframework/core/annotation/MergedAnnotations
- jdbc연결테스트코드
- Oracle join
- 마크다운 리스트
- 취성패
- git
- 정보처리기사
- 한글깨짐
- ejected-non-fast-forward
- java
- 이클립스
- git push
- 스프링
- rest방식
- 오라클연습문제
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