목록전체 글 (43)
방카@Dev
 [Spring]JDBC Template 정리
      
      
        [Spring]JDBC Template 정리
        1. Dependency 등록- JdbcTemplate은 spring-jdbc에 포함되어 있음 org.springframework spring-jdbc ${org.springframework-version} mysql mysql-connector-java 8.0.13 2. JdbcTemplate 스프링 빈 등록 3. JdbcTemplate 메서드 정리 (1) update(sql, ?에 들어갈 값) : 데이터를 변경할 때 사용(insert, update, delete)- 반환 타입이 int이므로 영향받은 로우 수를 반환- ?에 바인딩할 파라미터를 순서대로 전달 (2) queryForObject(sql, 반환받을 데이터 타입, ?에 들어갈 값 )- ..
 [Spring]게시판 파일 업로드 라이브러리(COS)
      
      
        [Spring]게시판 파일 업로드 라이브러리(COS)
        1. Dependency 추가 com.servlets cos 09May2002 2. 파일이 들어갈 boardupload 폴더 생성하기//폴더 경로C:\Users\BIT\Documents\Spring_exam ((스프링 워크스페이스)) \.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\{프로젝트명}\boardupload 3. 에서 불러올 경로 설정 4. 업로드 View 화면// MVC 게시판 글쓴이 비밀번호 제 목 내 용 파일 첨부   [등록] &..
 [Spring]Validator를 이용한 유효성 검사
      
      
        [Spring]Validator를 이용한 유효성 검사
        1. Validator 인터페이스 구현public class StudentValidator implements Validator { @Override public boolean supports(Class arg0) { // TODO Auto-generated method stub return Student.class.isAssignableFrom(arg0); } @Override public void validate(Object obj, Errors errors) { System.out.println("validate()"); Student student = (Student)obj; // 1번째 방법 String studentName = student.getName(); if(stu..
 [Spring]IntelliJ 자바 버전 변경하는 방법
      
      
        [Spring]IntelliJ 자바 버전 변경하는 방법
        학원 수업은 [IDE 이클립스 - 자바 버전 11 - 톰캣9] 환경설정으로 수업이 진행되기 때문에,김영한 강사님의 자바 스프링 수업에 필요한 환경설정인 [IDE IntelliJ-자바 버전 17 이상]도 구성하려면 별도의 조치를 취해줘야 한다. 이클립스가 JAVA_HOME 경로로 자바 jdk를 불러오기 때문에, IntelliJ를 실행한 후 별도의 jdk를 다운로드하고 총 네 곳에서 JDK를 변경해주면 된다.# Project Structure 먼저 우측상단의 톱니바퀴 모양을 눌러 Project Structrure에 들어간다. (1) Project Structure - Project Settings - Project - Project에서 SDK 선택지 하단의 Download JDK를 통해 자바 17을 다운받고..
 [Spring]MVC에서 데이터를 주고 받는 방법
      
      
        [Spring]MVC에서 데이터를 주고 받는 방법
        1. View에서 리소스 폴더의 이미지 불러오기 - resource 파일 경로 등록해두기 - view에서 resource 파일 불러오기2. Model 객체를 이용한 데이터 넘기기(1) 단일 값을 받는 경우@Controller@RequestMapping("/board")public class ViewController { @RequestMapping(value = "/content", method = RequestMethod.GET) public String boardcontent(Model model) { //매개변수에 model 넣기 model.addAttribute("id",30); //model에 데이터 넣기 return "/board/content"; }} view 파일 ..
 [Spring]AOP(Aspect Oriented Programming)_스프링 핵심원리(고급편)
      
      
        [Spring]AOP(Aspect Oriented Programming)_스프링 핵심원리(고급편)
        Aspect Oriented Programming with Spring :: Spring FrameworkAspect-oriented Programming (AOP) complements Object-oriented Programming (OOP) by providing another way of thinking about program structure. The key unit of modularity in OOP is the class, whereas in AOP the unit of modularity is the aspect. Aspects enabldocs.spring.io 스프링 핵심 원리 - 고급편 | 김영한 - 인프런김영한 | 스프링의 핵심 원리와 고급 기술들을 깊이있게 학습하고, 스프링..
0. 라이브러리import java.util.*;import java.io.*; 1. 변수 선언String[] arr1 = new String[5];int[] arr2 = {1,2,3};int N = 3;int[] arr3 = new int[N]; 2.Arraysint arr[] = {10, 8, 11, 2, 3, 0};// 1. 오름차순 {0, 2, 3, 8, 10, 11}Arrays.sort(arr1);// 2. 내림차순 {11, 10, 8, 3, 2, 0}Arrays.sort(arr1, Collections.reverseOrder());// 3. 일부만 정렬 {2, 8, 11, 10, 3, 0} (0~4만 정렬)Arrays.sort(arr1, 0, 4)// 4. 오름차순 정렬하면 binary sea..
 [Spring]Spring Environment
      
      
        [Spring]Spring Environment
        Environment Abstraction :: Spring FrameworkBean definition profiles provide a mechanism in the core container that allows for registration of different beans in different environments. The word, “environment,” can mean different things to different users, and this feature can help with many usedocs.spring.io# 개요- Spring Environment는 어플리케이션 내에서 프로필(Profiles)과 속성(Properties)을 유연하게 관리하기 위한 모델을 제공- ..
 [Spring]Bean 생성주기
      
      
        [Spring]Bean 생성주기
        package com.kbfg.digi;import org.springframework.context.support.GenericXmlApplicationContext;public class MainClass { public static void main(String[] args) { GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(); //생성 ctx.load("classpath:applicationCTX.xml"); //설정 ctx.refresh(); //안하면 load에서 해줌!! Student student = ctx.getBean("student",Student.class); //사용 System.o..
