게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
Spring 고수님 사랑합니다 질문좀..ㅠㅠㅋ
게시물ID : programmer_15307짧은주소 복사하기
작성자 : 씨알불
추천 : 0
조회수 : 2253회
댓글수 : 1개
등록시간 : 2016/01/05 01:23:36
옵션
  • 본인삭제금지
1.png


현재 스프링을 공부하는 초짜입니다.
책을 보면서 예제코드를 통해
STS를 이용해서 해보고 있습니다 -_-;;
개념도 개념이지만.. 예제를 돌려본다고해도 이해가 안되는 부분이 많네요 
아 그런데..

커넥션 객체는 잘 생성이 되었는데..

Tue Jan 05 01:17:47 KST 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

로그를 보니 이런 에러가 나오는데 -_- 이거 왜 그런건가요..



package org.zerock.web;

import java.sql.*;

import javax.inject.Inject;
import javax.sql.DataSource;


import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;


@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(
locations = {"file:src/main/webapp/WEB-INF/spring/**/*.xml"})

public class DataSourceTest{
@Inject
private DataSource ds;
//메소드
@Test
public void testConection(){
try {
//DB 연결
Connection conn = ds.getConnection();
System.out.println(conn);

//연결 종료
conn.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

MySQL과 연결을 담당하는 DataSource 라는 놈을 작성을 했는데..
애노테이션이라던가..


import javax.inject.Inject;
import javax.sql.DataSource;


import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

위 해당 임포트된 클래스 또는 인터페이스들이 정확히 무엇인지 잘 모르겠어요..
책에도 설명이 간단하게 나와있어요..ㅠㅠ
도와주세요 ㅠㅠ

꼬릿말 보기
전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호