@Repository
DAO class에서 쓰임
데이터베이스와 연동하여 데이터를 저장하거나 조회하는 데이터 계층의 클래스
@Repository
public class UserRepository {
@Autowired
private JdbcTemplate jdbcTemplate;
public User findById(Long id) {
String sql = "SELECT * FROM user WHERE id = ?";
return jdbcTemplate.queryForObject(sql, new Object[] { id }, new UserRowMapper());
}
}
https://standout.tistory.com/477
Annotation - @Autowired @Qualifier
@Autowired 메서드 파라미터에 맞는 타입의 빈을 찾아서 자동으로 주입 의존성 주입(Dependency Injection)을 자동화하는 데 사용되는 어노테이션 속성(field), setter method, constructor(생성자)에서 사용된다. @
standout.tistory.com
https://standout.tistory.com/91
SQL이란?
SQL Structured Query Language 데이터 베이스를 이용하기 위한 특수 목적의 프로그래밍 언어 https://ko.wikipedia.org/wiki/SQL SQL - 위키백과, 우리 모두의 백과사전 위키백과, 우리 모두의 백과사전. 이 도표는
standout.tistory.com
https://standout.tistory.com/379
OracleDriver ojdbc7 12.1.0.2.0 이란?
자바언어에서 오라클 데이터베이스와의 연동을 하기위한 드라이버 pom.xml에 추가 com.oracle ojdbc7 12.1.0.2 https://mvnrepository.com/artifact/com.oracle/ojdbc7/12.1.0.2
standout.tistory.com
https://standout.tistory.com/48
데이터베이스란?
Database 여러 사람이 공유하여 사용할 목적으로 체계화해 통합, 관리하는 데이터의 집합 일반적으로 데이터 테이블, 필드, 레코드 및 관계로 구성 https://ko.wikipedia.org/wiki/%EB%8D%B0%EC%9D%B4%ED%84%B0%EB%B2%
standout.tistory.com
'JAVA > Spring' 카테고리의 다른 글
Annotation - @ComponentScan (0) | 2023.04.20 |
---|---|
Annotation - @Configuration (0) | 2023.04.20 |
Annotation - @Service (0) | 2023.04.19 |
Annotation - @PostMapping (0) | 2023.04.19 |
Annotation - @GetMapping (0) | 2023.04.19 |