ManagerClass 만들기 1234567891011121314151617181920212223242526public class sqlSessionFactoryManager { private static SqlSessionFactory sqlSessionFactory; static{ //처음 한번 실행 InputStream is = null; try { is = Resources.getResourceAsStream("configuration.xml"); sqlSessionFactory = new SqlSessionFactoryBuilder().build(is); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(..
마이바티스(mybatis) 구성 환경설정파일( 마이바티스 정반에 걸친 셋팅 )- 매핑설정 파일이 어디에 있는지- 디비에 어떻게 접속 할껀지- 사용할 모델클래스들에 대한 별명 매핑 설정 파일- 사용할 sql문들에 대한 정의 Session빌드 및 사용- 실제 sql문 실행 1. pom.xml [ pom에 dependency 추가 - mysql, mybatis ] 1234567891011121314 mysql mysql-connector-java 5.1.38 org.mybatis mybatis 3.2.8 Colored by Color Scriptercs 2. xml 설정 파일 만들기 3.Mybatis홈페이지에서 configuration 가져와서 만든 xml에 추가해주기 mybatis 홈페이지 - http://..
jdbcTemplate 1. pom.xml 에다 dependency를 추가 해준다1234567891011121314151617181920212223242526 mysql mysql-connector-java 5.1.38 org.springframework spring-context 4.1.6.RELEASE org.springframework spring-core 4.1.6.RELEASE org.springframework spring-jdbc 4.1.6.RELEASE Colored by Color Scriptercs 2. jdbcTemplate을 사용해서 db에 값 넣기(update,insert,delete) 3. RowMapper을 사용해서 db 값 가져오기(select) 1234567891011121..
@postConstruct- 객체를 사용 시 호출 할 메소드를 지정 @PreDestory- 객체를 소멸 시 호출 할 메소드를 지정- close() 하기 직전에 실행 -> ((AbstractApplicationContext) context).close() 12345678910//초기화 메소드 @PostConstruct public void init(){ System.out.println("로봇 사용 완료!!"); } //소멸 메소드 @PreDestroy public void destory(){ System.out.println("로봇 이제 갈떄가 됨 ㅎㅎ"); }Colored by Color Scriptercs (!) xml에서 어노테이션을 사용 안하고 bean에 지정 하는 방법 -> init..
- Total
- Today
- Yesterday
- synchronized
- Default
- 하기
- 안드로이드
- nsis
- jsp
- Server
- Delete
- mybatis
- Android
- 음식
- iNT
- 라이브러리
- 어노테이션
- UTF-8
- js
- 스프링
- Controller
- Create
- spring
- 종류
- 사용
- Class
- jdbc
- mysql
- java
- 연결
- 생성
- 클래스
- 자바
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |