connect가 되어야 가능
create table spboard(
idx number not null,
title varchar2(100) not null,
content varchar2(2000) not null,
writer varchar2(20) not null,
indate date default sysdate,
count number default 0,
constraint pk_bd primary key(idx)
)
create sequence bd_seq
start with 1
increment by 1
maxvalue 100
cycle
nocache;
insert into SPBOARD(idx,title,content,writer) values (bd_seq.nextval,'제목1','내용1', '관리자',)
insert into SPBOARD(idx,title,content,writer) values (bd_seq.nextval,'제목2','내용2', '작성자1')
select * from SPBOARD
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>4.0.3</version>
</dependency>
<dependency>
<groupId>oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
</dependency>
<repositories>
<repository>
<id>oracle</id>
<name>ORACLE JDBC Repository</name>
<url>http://www.datanucleus.org/downloads/maven2/</url>
</repository>
</repositories>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>5.3.14</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.5.5</version>
</dependency>
<!-- HikariCP -->
<bean id="hikariConfig" class="com.zaxxer.hikari.HikariConfig">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
<property name="jdbcUrl" value="jdbc:oracle:thin:@localhost:1521:xe"/>
<property name="username" value="아이디"/>
<property name="password" value="비밀번호"/>
</bean>
<bean id="dataSource" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close">
<constructor-arg ref="hikariConfig" />
</bean>
위의 id와 밑에 ref의 값이 같아야된다.<!-- myBatis-spring API -->
<bean class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
</bean>
HikariCP의 아래 id와 myBatis의 ref와 동일해야된다.