test위에
com.oracle.database.jdbc
ojdbc8
23.2.0.0
maven repository
3.pom.xml
org.springframework
spring-jdbc
${org.springframework-version}
추가
root-context.xml
(/beans위에)
root-context.xml에서 value 를 contenxt.xml에서 resource name과 같게 해야한다 jdbc/ora
mybatis
1)
maven repostive - mybatis
test위에
mybatis spring 3.02
org.mybatis
mybatis-spring
3.0.2
둘다 pom.xmi test위에
2)
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="classpath:/mybatis/mybatis-config.xml" />
<property name="mapperLocations" value="classpath:/mybatis/mybatis-mapper.xml" />
</bean>
<bean id="sqlSessoinTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg name="sqlSessionFactory" ref="sqlSessionFactory" />
</bean>
root-context.xml
src/main/resources -> mybatis 폴더생성->mybatis-mapper.xml파일생성
Spring Legacy project -> mvc -> pom.xml -> version 1.6->1.8 3.1.1->5.3.29-> framework 복사해서 spring-jdbc로 수정 -> ojdbc8,mybatis,mybatisspring
com.oracle.database.jdbc
ojdbc8
23.2.0.0
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
org.mybatis
mybatis
3.5.13
org.mybatis
mybatis-spring
1.3.3
위에 붙여넣기
root-context.xml -> JndiObjectFactoryBean정의(Data source),SqlSessionFactoryBean정의(SqlSession)