본문 바로가기
반응형

{ Backend, Server }53

[Spring Security] Authentication 알아보기 참고한 글: https://docs.spring.io/spring-security/reference/servlet/authentication/architecture.html Servlet Authentication Architecture :: Spring Security ProviderManager is the most commonly used implementation of AuthenticationManager. ProviderManager delegates to a List of AuthenticationProvider instances. Each AuthenticationProvider has an opportunity to indicate that authentication should be s.. 2023. 2. 11.
[Spring Data JPA] 쿼리 메서드 Docs spring data jpa 쿼리 메서드 https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#jpa.query-methods.query-creation 2022. 10. 4.
스프링 부트 스트랩 적용 www.getbootstrap.com 다운로드 다운로드를 하면 css폴더와 js폴더가 있는데 둘다 복붙하여 스프링 파일 resources/static 하위에 붙여넣어준다. resources를 syncronize(디스크에서 다시 로드)해주고 프로젝트 빌드(망치 아이콘)를 다시 해주고 실행시키면 적용이 된다. 근데 이렇게 하면 스타일이 좀 구식으로 느껴질 수 있다. static/css 폴더 하위에 jumbotron-narrow.css를 하나 생성하고 다음을 붙여 넣자. /* Space out content a bit */ body { padding-top: 20px; padding-bottom: 20px; } /* Everything but the jumbotron gets side spacing for m.. 2022. 8. 2.
[Spring DB] 트랜잭션 알아보기 가장 과거의 방식부터 지금에 이르기까지 흐름을 따라가보자. v0. 초기 트랜잭션 코드 트랜잭션 적용 방법의 예시 더보기 /** * 트랜잭션 - 파라미터 연동, 풀을 고려한 종료 */ @Slf4j @RequiredArgsConstructor public class MemberServiceV2 { private final DataSource dataSource; private final MemberRepositoryV2 memberRepository; public void accountTransfer(String fromId, String toId, int money) throws SQLException { Connection con = dataSource.getConnection(); try { con.s.. 2022. 6. 16.
[Spring DB] JDBC, 커넥션풀, 데이터소스 알아보기 JDBC - 자바 API로, 자바에서 DB에 접근할 수 있도록 한다. JDBC는 대표적으로 아래 3가지 기능을 표준 인터페이스로 정의해서 제공한다. 1. java.sql.Connection - 연결 2. java.sql.Statement - SQL 전달 3. java.sql.ResultSet - 결과 응답 JDBC 기술 덕분에 많은 것이 편리해지긴 했지만, 각 DB마다 일부 SQL이 다르기 때문에 JDBC 코드를 변경하지 않더라도 SQL을 변경해야될 경우가 생긴다. 복잡한 JDBC 기술을 편리하게 사용해주는 방법으로 SQL Mapper 기술과 ORM기술이 있다. SQL Mapper 기술에는 JdbcTemplate, MyBatis가 있고 ORM 기술로는 JPA가 있다. 사용 예시 더보기 public Mem.. 2022. 6. 14.
[Spring MVC] 스프링 타입 컨버터 1. 타입 컨버터의 사용 타입 컨버터는 org.springframework.core.convert.converter.Converter 인터페이스를 구현하면 된다. package org.springframework.core.convert.converter; public interface Converter { T convert(S source); } 예시) Integer타입을 String타입으로 변환해주는 컨버터 @Slf4j public class IntegerToStringConverter implements Converter { @Override public String convert(Integer source) { log.info("convert source={}", source); return Str.. 2022. 5. 23.
반응형