list = null; Scanner sc = new Scanner(System.in); ScoreVO vo = new ScoreVO(); int su = 0; System.out.println("--- 학생 성적 입력 ---"); System.out.print("학번 입력 >> "); vo.setNo(sc.next()); System.out.print("이름 입력 >> "); vo.setName(sc.next()); System.out.print("국어 점수 >> "); vo.setKor(sc.nextInt()); System.out.print("영어 점수 >> "); vo.setEng(sc.nextInt()); System.out.print("수학 점수 >> "); vo.setMat(sc.nextInt()); su = scoreService.insertScore(vo); if ( su > 0) System.out.println("성적 등록 성공"> list = null; Scanner sc = new Scanner(System.in); ScoreVO vo = new ScoreVO(); int su = 0; System.out.println("--- 학생 성적 입력 ---"); System.out.print("학번 입력 >> "); vo.setNo(sc.next()); System.out.print("이름 입력 >> "); vo.setName(sc.next()); System.out.print("국어 점수 >> "); vo.setKor(sc.nextInt()); System.out.print("영어 점수 >> "); vo.setEng(sc.nextInt()); System.out.print("수학 점수 >> "); vo.setMat(sc.nextInt()); su = scoreService.insertScore(vo); if ( su > 0) System.out.println("성적 등록 성공"> list = null; Scanner sc = new Scanner(System.in); ScoreVO vo = new ScoreVO(); int su = 0; System.out.println("--- 학생 성적 입력 ---"); System.out.print("학번 입력 >> "); vo.setNo(sc.next()); System.out.print("이름 입력 >> "); vo.setName(sc.next()); System.out.print("국어 점수 >> "); vo.setKor(sc.nextInt()); System.out.print("영어 점수 >> "); vo.setEng(sc.nextInt()); System.out.print("수학 점수 >> "); vo.setMat(sc.nextInt()); su = scoreService.insertScore(vo); if ( su > 0) System.out.println("성적 등록 성공">
package com.score.main;
import java.util.List;
import java.util.Scanner;
import org.springframework.context.support.GenericXmlApplicationContext;
import com.score.bean.ScoreVO;
import com.score.service.ScoreService;
public class ScoreMain {
public static void main(String[] args) {
GenericXmlApplicationContext gxac = new GenericXmlApplicationContext("applicationContext.xml");
ScoreService scoreService = gxac.getBean("ScoreService", ScoreService.class);
List<ScoreVO> list = null;
Scanner sc = new Scanner(System.in);
ScoreVO vo = new ScoreVO();
int su = 0;
System.out.println("--- 학생 성적 입력 ---");
System.out.print("학번 입력 >> ");
vo.setNo(sc.next());
System.out.print("이름 입력 >> ");
vo.setName(sc.next());
System.out.print("국어 점수 >> ");
vo.setKor(sc.nextInt());
System.out.print("영어 점수 >> ");
vo.setEng(sc.nextInt());
System.out.print("수학 점수 >> ");
vo.setMat(sc.nextInt());
su = scoreService.insertScore(vo);
if ( su > 0)
System.out.println("성적 등록 성공,,,");
else
System.out.println("성적 등록 실패,,,");
System.out.println("--- 성 적 목 록 ---");
list = scoreService.getScoreList(vo);
for(ScoreVO score : list) {
System.out.println(score);
}
System.out.println();
sc.close();
gxac.close();
}
}