본문 바로가기

template3

[django] 장고의 설계 원칙 장고의 설계 원칙 https://docs.djangoproject.com/en/1.7/misc/design-philosophies/ https://docs.djangoproject.com/en/1.11/misc/design-philosophies/ 일반 사항 약한 결합(Loose coupling) 경량 코드(Less code) 신속 개발(Quick development) 반복 방지(DRY, Don't Repeat Yourself) 암시보다는 명시적으로 표현(Explicit is better than implicit) 일관성(Consistency) 모델 암시보다는 명시적으로 표현(Explicit is better than implicit) 관련 도메인 로직을 모두 포함(Include all rele.. 2017. 6. 30.
[Spring] JDBC 설정 [Spring] JDBC 설정 DataSource 설정 JdbcTemplate 생성 JdbcTemplate 를 사용한다. JdbcTemplate template; UserRowMapper 클래스 생성RowMapper 를 구현한다. class UserRowMapper implements RowMapper{ @Override public UserVO mapRow(ResultSet arg0, int arg1) throws SQLException { // TODO Auto-generated method stub return null; } } 컬럼데이터를 바이딩해 준다. class UserRowMapper implements RowMapper { @Override public UserVO mapRow(Result.. 2016. 4. 24.
[spring] 데이터 접근 디자인 패턴 [spring] 데이터 접근 디자인 패턴 Template Method Pattern JDBC 개념 인터페이스만 보고 작업을 한다. JDBC DRIVER 를 사용한다. JDBC 구현 순서 특정 DBMS 에ego당하는 Driver 로딩 DBMS 와의 Connection 연결 Statement 객체 생성 SQL 문에 파라미터 정보 설정 Statement 실행 ResultSet 처리하기 위한 Loop 문 실행 예외처리 트랜잭션 처리 Connection 해제 기본형태 생성 Connection con = null; PreparedStatement ps = null; ResultSet rs = null; int result = 0; try { con = JDBCUtil.getConnection(); ps = con... 2016. 4. 23.